avformat/aea: reduce false positives in probing
Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0d7a14e236
commit
e01467241f
@ -34,12 +34,8 @@ static int aea_read_probe(AVProbeData *p)
|
|||||||
|
|
||||||
/* Magic is '00 08 00 00' in Little Endian*/
|
/* Magic is '00 08 00 00' in Little Endian*/
|
||||||
if (AV_RL32(p->buf)==0x800) {
|
if (AV_RL32(p->buf)==0x800) {
|
||||||
int bsm_s, bsm_e, inb_s, inb_e, ch;
|
int ch, i;
|
||||||
ch = p->buf[264];
|
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];
|
|
||||||
|
|
||||||
if (ch != 1 && ch != 2)
|
if (ch != 1 && ch != 2)
|
||||||
return 0;
|
return 0;
|
||||||
@ -48,8 +44,17 @@ static int aea_read_probe(AVProbeData *p)
|
|||||||
* the block size mode bytes have to be the same
|
* the block size mode bytes have to be the same
|
||||||
* the info bytes have to be the same
|
* the info bytes have to be the same
|
||||||
*/
|
*/
|
||||||
if (bsm_s == bsm_e && inb_s == inb_e)
|
for (i = 2048; i + 211 < p->buf_size; i+= 212) {
|
||||||
return AVPROBE_SCORE_MAX / 4 + 1;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user