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:53:38 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-11-10 16:25:35 +0400
commit9225ebd50d4f5fb88c05df59367b6b9b6e792773 (patch)
treefa560172f2b02d9da5fe126487cd8020ea2cb7f5 /libavformat/swfdec.c
parentb57083529650be5417056453fae8b2bf2dface59 (diff)
avformat/swfdec: return AVPROBE_SCORE_MAX / 4 for unexpected versions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/swfdec.c')
-rw-r--r--libavformat/swfdec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index aa6ce8464e..e6ceec818a 100644
--- a/libavformat/swfdec.c
+++ b/libavformat/swfdec.c
@@ -59,11 +59,14 @@ static int swf_probe(AVProbeData *p)
return 0;
/* check file header */
- if ((p->buf[0] == 'F' || p->buf[0] == 'C') && p->buf[1] == 'W' &&
- p->buf[2] == 'S' && p->buf[3] < 20)
- return AVPROBE_SCORE_MAX;
- else
+ if ( AV_RB24(p->buf) != AV_RB24("CWS")
+ && AV_RB24(p->buf) != AV_RB24("FWS"))
return 0;
+
+ if (p->buf[3] >= 20)
+ return AVPROBE_SCORE_MAX / 4;
+
+ return AVPROBE_SCORE_MAX;
}
#if CONFIG_ZLIB