From 2e78513ceee5c75248f2b765709307e339ede0b6 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Tue, 3 Mar 2009 05:53:38 +0000 Subject: [PATCH] flacdec: Warn about invalid max blocksize and limit the minimum value. Originally committed as revision 17751 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/flacdec.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 80c03182a5..895214c746 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -187,6 +187,11 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, skip_bits(&gb, 16); /* skip min blocksize */ s->max_blocksize = get_bits(&gb, 16); + if (s->max_blocksize < 16) { + av_log(avctx, AV_LOG_WARNING, "invalid max blocksize: %d\n", + s->max_blocksize); + s->max_blocksize = 16; + } skip_bits(&gb, 24); /* skip min frame size */ s->max_framesize = get_bits_long(&gb, 24);