]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/swfdec.c
avformat/swfdec: check version and size during probing
[ffmpeg] / libavformat / swfdec.c
index 54e0f6dc0ee4090b46d354f4f3575817faf28547..aa6ce8464ef0450f1d42c8ebe72f2d86460e2a8f 100644 (file)
@@ -55,9 +55,12 @@ static int get_swf_tag(AVIOContext *pb, int *len_ptr)
 
 static int swf_probe(AVProbeData *p)
 {
+    if(p->buf_size < 15)
+        return 0;
+
     /* check file header */
     if ((p->buf[0] == 'F' || p->buf[0] == 'C') && p->buf[1] == 'W' &&
-        p->buf[2] == 'S')
+        p->buf[2] == 'S' && p->buf[3] < 20)
         return AVPROBE_SCORE_MAX;
     else
         return 0;