[FFmpeg-cvslog] avformat/m4vdec: Check for non startcode 00 00 00 sequences in probe

Michael Niedermayer git at videolan.org
Sun Dec 21 04:50:26 CET 2014


ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Sun Sep  7 16:39:39 2014 +0200| [a76198ed288bc93e9a4019c4f04f79a9cf210285] | committer: Michael Niedermayer

avformat/m4vdec: Check for non startcode 00 00 00 sequences in probe

Fixes miss detection of PCM as m4v
Fixes Ticket 3928

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 7c1835c52a4be2e4e996f83c91a8d5a147b01100)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a76198ed288bc93e9a4019c4f04f79a9cf210285
---

 libavformat/m4vdec.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/m4vdec.c b/libavformat/m4vdec.c
index e72fb42..2deff32 100644
--- a/libavformat/m4vdec.c
+++ b/libavformat/m4vdec.c
@@ -33,13 +33,15 @@ static int mpeg4video_probe(AVProbeData *probe_packet)
 
     for(i=0; i<probe_packet->buf_size; i++){
         temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
-        if ((temp_buffer & 0xffffff00) != 0x100)
+        if (temp_buffer & 0xfffffe00)
+            continue;
+        if (temp_buffer < 2)
             continue;
 
         if (temp_buffer == VOP_START_CODE)                         VOP++;
         else if (temp_buffer == VISUAL_OBJECT_START_CODE)          VISO++;
-        else if (temp_buffer < 0x120)                              VO++;
-        else if (temp_buffer < 0x130)                              VOL++;
+        else if (temp_buffer >= 0x100 && temp_buffer < 0x120)      VO++;
+        else if (temp_buffer >= 0x120 && temp_buffer < 0x130)      VOL++;
         else if (   !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
                  && !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
     }



More information about the ffmpeg-cvslog mailing list