diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-05-28 15:46:10 +0400 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-05-28 15:46:10 +0400 |
commit | ced0307ea94bb55d00631094d3c188167aa87b4d (patch) | |
tree | 988e198829cf7e98387daae934730e826df72c80 /libavformat/tta.c | |
parent | 35e683e457b6b6d8a2ce57b1ca6d97a92ba79adb (diff) |
tta: make probing more robust
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat/tta.c')
-rw-r--r-- | libavformat/tta.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/tta.c b/libavformat/tta.c index e6ded521ba..656f914a5d 100644 --- a/libavformat/tta.c +++ b/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; } |