aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-05-28 11:46:10 +0000
committerPaul B Mahol <onemda@gmail.com>2013-05-28 11:46:10 +0000
commitced0307ea94bb55d00631094d3c188167aa87b4d (patch)
tree988e198829cf7e98387daae934730e826df72c80 /libavformat
parent35e683e457b6b6d8a2ce57b1ca6d97a92ba79adb (diff)
downloadffmpeg-ced0307ea94bb55d00631094d3c188167aa87b4d.tar.gz
tta: make probing more robust
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/tta.c8
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;
}