[FFmpeg-cvslog] r24054 - trunk/libavcodec/dca.c

banan subversion
Mon Jul 5 10:16:43 CEST 2010


Author: banan
Date: Mon Jul  5 10:16:43 2010
New Revision: 24054

Log:
DCA: Occasionally a false XCH sync word can turn up after the core DTS data,
to verify the sync word the extension fsize field should be compared to
the core data length field.

Patch by nick.nbrereton at net

Modified:
   trunk/libavcodec/dca.c

Modified: trunk/libavcodec/dca.c
==============================================================================
--- trunk/libavcodec/dca.c	Mon Jul  5 06:07:50 2010	(r24053)
+++ trunk/libavcodec/dca.c	Mon Jul  5 10:16:43 2010	(r24054)
@@ -1298,7 +1298,13 @@ static int dca_decode_frame(AVCodecConte
         switch(bits) {
         case 0x5a5a5a5a: {
             int ext_base_ch = s->prim_channels;
-            int ext_amode;
+            int ext_amode, xch_fsize;
+
+            /* validate sync word using XCHFSIZE field */
+            xch_fsize = show_bits(&s->gb, 10);
+            if((s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize) &&
+               (s->frame_size != (get_bits_count(&s->gb) >> 3) - 4 + xch_fsize + 1))
+                continue;
 
             /* skip length-to-end-of-frame field for the moment */
             skip_bits(&s->gb, 10);



More information about the ffmpeg-cvslog mailing list