aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-23 18:41:53 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-23 18:41:53 +0100
commite01467241fe784f0e4acff60ff23f77c08c276ba (patch)
treec614877a260743c882393809c5ad12f122f3f60c
parent0d7a14e236eb05ae0473d2df3276a26f4b6596c8 (diff)
downloadffmpeg-e01467241fe784f0e4acff60ff23f77c08c276ba.tar.gz
avformat/aea: reduce false positives in probing
Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/aea.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/libavformat/aea.c b/libavformat/aea.c
index 15b9b1cd32..4ace52a32d 100644
--- a/libavformat/aea.c
+++ b/libavformat/aea.c
@@ -34,12 +34,8 @@ static int aea_read_probe(AVProbeData *p)
/* Magic is '00 08 00 00' in Little Endian*/
if (AV_RL32(p->buf)==0x800) {
- int bsm_s, bsm_e, inb_s, inb_e, ch;
- ch = p->buf[264];
- bsm_s = p->buf[2048];
- inb_s = p->buf[2048+1];
- inb_e = p->buf[2048+210];
- bsm_e = p->buf[2048+211];
+ int ch, i;
+ ch = p->buf[264];
if (ch != 1 && ch != 2)
return 0;
@@ -48,8 +44,17 @@ static int aea_read_probe(AVProbeData *p)
* the block size mode bytes have to be the same
* the info bytes have to be the same
*/
- if (bsm_s == bsm_e && inb_s == inb_e)
- return AVPROBE_SCORE_MAX / 4 + 1;
+ for (i = 2048; i + 211 < p->buf_size; i+= 212) {
+ int bsm_s, bsm_e, inb_s, inb_e;
+ bsm_s = p->buf[0];
+ inb_s = p->buf[1];
+ inb_e = p->buf[210];
+ bsm_e = p->buf[211];
+
+ if (bsm_s != bsm_e || inb_s != inb_e)
+ return 0;
+ }
+ return AVPROBE_SCORE_MAX / 4 + 1;
}
return 0;
}