[FFmpeg-cvslog] avformat/ape: check version in probe
Michael Niedermayer
git at videolan.org
Sun Nov 10 13:38:37 CET 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 10 12:48:33 2013 +0100| [b57083529650be5417056453fae8b2bf2dface59] | committer: Michael Niedermayer
avformat/ape: check version in probe
Fixes probetest failure
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b57083529650be5417056453fae8b2bf2dface59
---
libavformat/ape.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/libavformat/ape.c b/libavformat/ape.c
index 613a59d..6f82480 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)
More information about the ffmpeg-cvslog
mailing list