Skip to content
Permalink
Browse files Browse the repository at this point in the history
m4vdec: Check for non-startcode 00 00 00 sequences in probe
This makes the m4v detection less trigger-happy.

Bug-Id: 949
Signed-off-by: Diego Biurrun <diego@biurrun.de>
  • Loading branch information
michaelni authored and DonDiego committed Aug 3, 2016
1 parent 3ccec33 commit e5b0197
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libavformat/m4vdec.c
Expand Up @@ -33,16 +33,18 @@ 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)
else if (temp_buffer >= 0x100 && temp_buffer < 0x120)
VO++;
else if (temp_buffer < 0x130)
else if (temp_buffer >= 0x120 && temp_buffer < 0x130)
VOL++;
else if (!(0x1AF < temp_buffer && temp_buffer < 0x1B7) &&
!(0x1B9 < temp_buffer && temp_buffer < 0x1C4))
Expand Down

0 comments on commit e5b0197

Please sign in to comment.