OSDN Git Service

Define FLAC_MIN_FRAME_SIZE and use it in the FLAC decoder.
authorMichael Chinen <mchinen@gmail.com>
Tue, 7 Dec 2010 14:58:34 +0000 (14:58 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Tue, 7 Dec 2010 14:58:34 +0000 (14:58 +0000)
Patch by Michael Chinen [mchinen at gmail]

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

libavcodec/flac.h
libavcodec/flacdec.c

index 7bcc1a1..fcd8099 100644 (file)
@@ -34,6 +34,7 @@
 #define FLAC_MAX_CHANNELS       8
 #define FLAC_MIN_BLOCKSIZE     16
 #define FLAC_MAX_BLOCKSIZE  65535
+#define FLAC_MIN_FRAME_SIZE    11
 
 enum {
     FLAC_CHMODE_INDEPENDENT =  0,
index 71a2c58..18ea0ac 100644 (file)
@@ -566,7 +566,7 @@ static int flac_decode_frame(AVCodecContext *avctx,
     /* check that there is at least the smallest decodable amount of data.
        this amount corresponds to the smallest valid FLAC frame possible.
        FF F8 69 02 00 00 9A 00 00 34 46 */
-    if (buf_size < 11)
+    if (buf_size < FLAC_MIN_FRAME_SIZE)
         return buf_size;
 
     /* check for inline header */