aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-07 16:39:39 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-07 16:39:39 +0200
commit7c1835c52a4be2e4e996f83c91a8d5a147b01100 (patch)
treedca9f65f86435b4af17cc85f0cf11e872904d331 /libavformat
parentcfce6f7efd28130bf0dd409b2367ca0f8c9b2417 (diff)
downloadffmpeg-7c1835c52a4be2e4e996f83c91a8d5a147b01100.tar.gz
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@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/m4vdec.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/m4vdec.c b/libavformat/m4vdec.c
index ead0066cca..80bd75e589 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++;
}