Improve SIFF probe by also checking the first tag is one of the expected.
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 17 Sep 2009 18:09:20 +0000 (18:09 +0000)
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>
Thu, 17 Sep 2009 18:09:20 +0000 (18:09 +0000)
Originally committed as revision 19898 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/siff.c

index 63fc0d6..1194f71 100644 (file)
@@ -60,11 +60,12 @@ typedef struct SIFFContext{
 
 static int siff_probe(AVProbeData *p)
 {
+    uint32_t tag = AV_RL32(p->buf + 8);
     /* check file header */
-    if (AV_RL32(p->buf) == TAG_SIFF)
-        return AVPROBE_SCORE_MAX;
-    else
+    if (AV_RL32(p->buf) != TAG_SIFF ||
+        (tag != TAG_VBV1 && tag != TAG_SOUN))
         return 0;
+    return AVPROBE_SCORE_MAX;
 }
 
 static int create_audio_stream(AVFormatContext *s, SIFFContext *c)