[FFmpeg-cvslog] r25910 - trunk/libavcodec/flac.c

jbr subversion
Tue Dec 7 14:42:52 CET 2010


Author: jbr
Date: Tue Dec  7 14:42:52 2010
New Revision: 25910

Log:
Check validity of the frame sync code in ff_flac_decode_frame_header().
Patch by Michael Chinen [mchinen at gmail]

Modified:
   trunk/libavcodec/flac.c

Modified: trunk/libavcodec/flac.c
==============================================================================
--- trunk/libavcodec/flac.c	Tue Dec  7 14:30:18 2010	(r25909)
+++ trunk/libavcodec/flac.c	Tue Dec  7 14:42:52 2010	(r25910)
@@ -38,7 +38,13 @@ int ff_flac_decode_frame_header(AVCodecC
     int bs_code, sr_code, bps_code;
 
     /* frame sync code */
-    skip_bits(gb, 16);
+    if ((get_bits(gb, 15) & 0x7FFF) != 0x7FFC) {
+        av_log(avctx, AV_LOG_ERROR, "invalid sync code\n");
+        return -1;
+    }
+
+    /* variable block size stream code */
+    skip_bits1(gb);
 
     /* block size and sample rate codes */
     bs_code = get_bits(gb, 4);



More information about the ffmpeg-cvslog mailing list