Browse Source

idf: Improve idf_probe() so it doesnt succeed on 0 byte input

Michael Niedermayer 13 years ago
parent
commit
658c5209fb
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libavformat/bintext.c

+ 3 - 1
libavformat/bintext.c

@@ -261,7 +261,9 @@ static const uint8_t idf_magic[] = {
 
 static int idf_probe(AVProbeData *p)
 {
-    if (!memcmp(p->buf, idf_magic, FFMIN(sizeof(idf_magic), p->buf_size)))
+    if (p->buf_size < sizeof(idf_magic))
+        return 0;
+    if (!memcmp(p->buf, idf_magic, sizeof(idf_magic)))
         return AVPROBE_SCORE_MAX;
     return 0;
 }