Commit f05ed60a authored by jbr's avatar jbr

flacdec: Add a check for small buffer size. This ensures reading as

much of the frame header as possible without excluding the smallest 
possible FLAC frame.  It also fixes a false positive warning message 
that was being emitted at the end of decoding.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17816 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 4e97e4ef
......@@ -639,6 +639,11 @@ static int flac_decode_frame(AVCodecContext *avctx,
init_get_bits(&s->gb, buf, buf_size*8);
/* check that there is at least the smallest decodable amount of data.
this amount corresponds to the smallest valid FLAC frame possible. */
if (buf_size < 24)
goto end;
/* check for inline header */
if (show_bits_long(&s->gb, 32) == MKBETAG('f','L','a','C')) {
if (metadata_parse(s)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment