1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-13 08:00:49 +02:00

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
This commit is contained in:
Justin Ruggles 2009-03-03 05:22:44 +00:00
parent c978997a88
commit dde318d5d9

View File

@ -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;