From: banan Date: Sat, 25 Apr 2009 17:46:27 +0000 (+0000) Subject: Make sure we only parse max amount of subpackets (5) in the cook decoder. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/frescor/ffmpeg.git/commitdiff_plain/4a565c9de09777d76541d3eb0dad6064ad6d5db5 Make sure we only parse max amount of subpackets (5) in the cook decoder. git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18689 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b --- diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 8a909df0a..99d1bdb8c 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1219,6 +1219,10 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) q->num_subpackets++; s++; + if (s > MAX_SUBPACKETS) { + av_log(avctx,AV_LOG_ERROR,"Too many subpackets > 5, report file!\n"); + return -1; + } } /* Generate tables */ init_pow2table();