Browse Source

tta: make probing more robust

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n2.0
Paul B Mahol 12 years ago
parent
commit
ced0307ea9
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      libavformat/tta.c

+ 5
- 3
libavformat/tta.c View File

@@ -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