From ced0307ea94bb55d00631094d3c188167aa87b4d Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Tue, 28 May 2013 11:46:10 +0000 Subject: [PATCH] tta: make probing more robust Signed-off-by: Paul B Mahol --- libavformat/tta.c | 8 +++++--- 1 file 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; }