summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-07 16:39:39 +0200
committerDiego Biurrun <diego@biurrun.de>2016-08-03 08:27:02 +0200
commite5b019725f53b79159931d3a7317107cbbfd0860 (patch)
tree9faf172b712f4c35098d2753612b076666ba0ff7 /libavformat
parent3ccec334b8502701e72ef13bed25913c3578022e (diff)
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>
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 4a0af3c037..9d69dcc042 100644
--- a/libavformat/m4vdec.c
+++ b/libavformat/m4vdec.c
@@ -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))