summaryrefslogtreecommitdiff
path: root/libavformat/mtv.c
diff options
context:
space:
mode:
authorReynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>2014-01-24 18:40:04 -0300
committerReynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>2014-02-01 21:09:14 -0800
commit95d180998193da60fbcacf59f920c98a0bf43c66 (patch)
treed1ac13de65e129523bee9e04b2c504c38c801518 /libavformat/mtv.c
parentef034cbf185e1938000a117bd16aa6b33046f479 (diff)
libavformat/mtv: add test for audio magic
MTV files have the string "MP3" as audio magic on their header. Always. Signed-off-by: Reynaldo H. Verdejo Pinochet <r.verdejo@sisa.samsung.com>
Diffstat (limited to 'libavformat/mtv.c')
-rw-r--r--libavformat/mtv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mtv.c b/libavformat/mtv.c
index 071af4c67b..b449d5886f 100644
--- a/libavformat/mtv.c
+++ b/libavformat/mtv.c
@@ -63,6 +63,10 @@ static int mtv_probe(AVProbeData *p)
if (*p->buf != 'A' || *(p->buf + 1) != 'M' || *(p->buf + 2) != 'V')
return 0;
+ /* Audio magic is always MP3 */
+ if (p->buf[43] != 'M' || p->buf[44] != 'P' || p->buf[45] != '3')
+ return 0;
+
/* Check for nonzero in bpp and (width|height) header fields */
if(!(p->buf[51] && AV_RL16(&p->buf[52]) | AV_RL16(&p->buf[54])))
return 0;