flacdec: Return error when blocksize code of 0 is found. It is a
authorJustin Ruggles <justin.ruggles@gmail.com>
Tue, 3 Mar 2009 05:22:44 +0000 (05:22 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Tue, 3 Mar 2009 05:22:44 +0000 (05:22 +0000)
reserved value per the FLAC format documentation.

Originally committed as revision 17747 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/flacdec.c

index 8c73434..79c2142 100644 (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;