tta: make probing more robust

Signed-off-by: Paul B Mahol <onemda@gmail.com>
pull/23/head
Paul B Mahol 12 years ago
parent 35e683e457
commit ced0307ea9
  1. 8
      libavformat/tta.c

@ -33,9 +33,11 @@ typedef struct {
static int tta_probe(AVProbeData *p)
{
const uint8_t *d = p->buf;
if (d[0] == 'T' && d[1] == 'T' && d[2] == 'A' && d[3] == '1')
if (AV_RL32(&p->buf[0]) == MKTAG('T', 'T', 'A', '1') &&
(AV_RL16(&p->buf[4]) == 1 || AV_RL16(&p->buf[4]) == 2) &&
AV_RL16(&p->buf[6]) > 0 &&
AV_RL16(&p->buf[8]) > 0 &&
AV_RL32(&p->buf[10]) > 0)
return AVPROBE_SCORE_EXTENSION + 30;
return 0;
}

Loading…
Cancel
Save