[FFmpeg-cvslog] r10726 - in trunk/libavcodec: aac_parser.c ac3_parser.c

michael subversion
Sat Oct 13 14:25:31 CEST 2007


Author: michael
Date: Sat Oct 13 14:25:31 2007
New Revision: 10726

Log:
prevent infinite loop and memcpy of negative amounts
fixes issue194


Modified:
   trunk/libavcodec/aac_parser.c
   trunk/libavcodec/ac3_parser.c

Modified: trunk/libavcodec/aac_parser.c
==============================================================================
--- trunk/libavcodec/aac_parser.c	(original)
+++ trunk/libavcodec/aac_parser.c	Sat Oct 13 14:25:31 2007
@@ -67,6 +67,9 @@ static int aac_sync(const uint8_t *buf, 
     skip_bits1(&bits);          /* copyright_identification_bit */
     skip_bits1(&bits);          /* copyright_identification_start */
     size = get_bits(&bits, 13); /* aac_frame_length */
+    if(size < AAC_HEADER_SIZE)
+        return 0;
+
     skip_bits(&bits, 11);       /* adts_buffer_fullness */
     rdb = get_bits(&bits, 2);   /* number_of_raw_data_blocks_in_frame */
 

Modified: trunk/libavcodec/ac3_parser.c
==============================================================================
--- trunk/libavcodec/ac3_parser.c	(original)
+++ trunk/libavcodec/ac3_parser.c	Sat Oct 13 14:25:31 2007
@@ -114,6 +114,9 @@ static int ac3_sync(const uint8_t *buf, 
             return 0;   /* Currently don't support additional streams */
 
         frmsiz = get_bits(&bits, 11) + 1;
+        if(frmsiz*2 < AC3_HEADER_SIZE)
+            return 0;
+
         fscod = get_bits(&bits, 2);
         if (fscod == 3) {
             fscod2 = get_bits(&bits, 2);




More information about the ffmpeg-cvslog mailing list