[FFmpeg-cvslog] tta: make probing more robust

Paul B Mahol git at videolan.org
Tue May 28 13:54:20 CEST 2013


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue May 28 11:46:10 2013 +0000| [ced0307ea94bb55d00631094d3c188167aa87b4d] | committer: Paul B Mahol

tta: make probing more robust

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ced0307ea94bb55d00631094d3c188167aa87b4d
---

 libavformat/tta.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/tta.c b/libavformat/tta.c
index e6ded52..656f914 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;
 }



More information about the ffmpeg-cvslog mailing list