Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-10 15:48:33 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-11-10 16:25:35 +0400
commitb57083529650be5417056453fae8b2bf2dface59 (patch)
tree05103d51d777e8cb11b8c60cc4eb692185d21893 /libavformat/ape.c
parentbc273095916320596fcd07dcd165a5620213420b (diff)
avformat/ape: check version in probe
Fixes probetest failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/ape.c')
-rw-r--r--libavformat/ape.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 613a59d5f8..6f824800a3 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -86,10 +86,14 @@ typedef struct {
static int ape_probe(AVProbeData * p)
{
- if (p->buf[0] == 'M' && p->buf[1] == 'A' && p->buf[2] == 'C' && p->buf[3] == ' ')
- return AVPROBE_SCORE_MAX;
+ int version = AV_RL16(p->buf+4);
+ if (AV_RL32(p->buf) != MKTAG('M', 'A', 'C', ' '))
+ return 0;
- return 0;
+ if (version < APE_MIN_VERSION || version > APE_MAX_VERSION)
+ return AVPROBE_SCORE_MAX/4;
+
+ return AVPROBE_SCORE_MAX;
}
static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx)