aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2020-09-03 17:50:45 +0200
committerPaul B Mahol <onemda@gmail.com>2020-09-03 18:03:18 +0200
commit69e22e21e3aaf92bb4038646f18a3d64fb6b636e (patch)
treec8452f6e59c83dc9c738d9dcbea6542de580b8f2
parent4cfe8123ea13aa94a61409dc27fa27e521e2340e (diff)
downloadffmpeg-69e22e21e3aaf92bb4038646f18a3d64fb6b636e.tar.gz
avformat/musx: improve probing
-rw-r--r--libavformat/musx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libavformat/musx.c b/libavformat/musx.c
index 8537eb7e72..9dd721182a 100644
--- a/libavformat/musx.c
+++ b/libavformat/musx.c
@@ -20,12 +20,23 @@
*/
#include "libavutil/avassert.h"
+#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
static int musx_probe(const AVProbeData *p)
{
- if (memcmp(p->buf, "MUSX", 4))
+ unsigned version;
+
+ if (AV_RB32(p->buf) != MKBETAG('M','U','S','X'))
+ return 0;
+
+ version = AV_RL32(p->buf + 8);
+ if (version != 10 &&
+ version != 6 &&
+ version != 5 &&
+ version != 4 &&
+ version != 201)
return 0;
return AVPROBE_SCORE_MAX / 5 * 2;