diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 05:53:38 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 05:53:38 +0000 |
commit | 2e78513ceee5c75248f2b765709307e339ede0b6 (patch) | |
tree | 2746d3faffc56428945af7d29007ea48cb9db323 /libavcodec/flacdec.c | |
parent | 09a64ee6140c2f30184613b1b2b9a01e083c4a84 (diff) | |
download | ffmpeg-streaming-2e78513ceee5c75248f2b765709307e339ede0b6.zip ffmpeg-streaming-2e78513ceee5c75248f2b765709307e339ede0b6.tar.gz |
flacdec: Warn about invalid max blocksize and limit the minimum value.
Originally committed as revision 17751 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/flacdec.c')
-rw-r--r-- | libavcodec/flacdec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 80c0318..895214c 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); |