diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2007-11-19 20:14:46 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2007-11-19 20:14:46 +0000 |
commit | 2867ed9b1c0561b0e50d9c4f73e09621333e2f1f (patch) | |
tree | 85cde17e305a3c37dd936aaa5db995242b8f9be5 /libavcodec/dvbsubdec.c | |
parent | c5a2fe8f1f89b3fb6cbdbe7a143e73c7e064715b (diff) | |
download | ffmpeg-2867ed9b1c0561b0e50d9c4f73e09621333e2f1f.tar.gz |
check region depth for validity
(32/64/128 would crash at least due to 1<<depth allocation later,
and no i do not have a sample file)
Originally committed as revision 11062 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r-- | libavcodec/dvbsubdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index b410a24b25..b51603f30e 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1035,6 +1035,10 @@ static void dvbsub_parse_region_segment(AVCodecContext *avctx, } 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++; if (region->depth == 8) |