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
release/0.6
Justin Ruggles 16 years ago
parent c978997a88
commit dde318d5d9
  1. 7
      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;

Loading…
Cancel
Save