diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 05:22:44 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2009-03-03 05:22:44 +0000 |
commit | dde318d5d98dd06407880070e8d558a1251c197d (patch) | |
tree | 71da430b62e23985dd1250b1a74b9907ee7d19e0 | |
parent | c978997a88267d046c752fb2c0599de81f38f4ae (diff) | |
download | ffmpeg-dde318d5d98dd06407880070e8d558a1251c197d.tar.gz |
flacdec: Return error when blocksize code of 0 is found. It is a
reserved value per the FLAC format documentation.
Originally committed as revision 17747 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/flacdec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 8c73434912..79c2142237 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -527,9 +527,10 @@ static int decode_frame(FLACContext *s, int alloc_data_size) return -1; } - if (blocksize_code == 0) - blocksize = s->min_blocksize; - else if (blocksize_code == 6) + if (blocksize_code == 0) { + av_log(s->avctx, AV_LOG_ERROR, "reserved blocksize code: 0\n"); + return -1; + } else if (blocksize_code == 6) blocksize = get_bits(&s->gb, 8)+1; else if (blocksize_code == 7) blocksize = get_bits(&s->gb, 16)+1; |