Commit 3fab9e32 authored by michael's avatar michael

check region depth for validity

(32/64/128 would crash at least due to 1<<depth allocation later, and no i dont have
a sample file)


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11062 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2773409e
...@@ -1035,6 +1035,10 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx, ...@@ -1035,6 +1035,10 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx,
} }
region->depth = 1 << (((*buf++) >> 2) & 7); region->depth = 1 << (((*buf++) >> 2) & 7);
if(region->depth<2 || region->depth>8){
av_log(avctx, AV_LOG_ERROR, "region depth %d is invalid\n", region->depth);
region->depth= 4;
}
region->clut = *buf++; region->clut = *buf++;
if (region->depth == 8) if (region->depth == 8)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment