[FFmpeg-cvslog] avformat/swfdec: return AVPROBE_SCORE_MAX / 4 for unexpected versions

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:53:38 2013 +0100| [9225ebd50d4f5fb88c05df59367b6b9b6e792773] | committer: Michael Niedermayer

avformat/swfdec: return AVPROBE_SCORE_MAX / 4 for unexpected versions

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9225ebd50d4f5fb88c05df59367b6b9b6e792773
---

 libavformat/swfdec.c |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c
index aa6ce84..e6ceec8 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



More information about the ffmpeg-cvslog mailing list