[FFmpeg-devel] [PATCH] slightly improved dxa probe

Reimar Döffinger Reimar.Doeffinger
Tue Sep 15 10:46:23 CEST 2009


Only a very minor improvement, though enough to fool probetest...
Index: libavformat/dxa.c
===================================================================
--- libavformat/dxa.c   (revision 19849)
+++ libavformat/dxa.c   (working copy)
@@ -36,9 +36,15 @@
 
 static int dxa_probe(AVProbeData *p)
 {
+    int w, h;
+    if (p->buf_size < 15)
+        return 0;
+    w = AV_RB16(p->buf + 11);
+    h = AV_RB16(p->buf + 13);
     /* check file header */
     if (p->buf[0] == 'D' && p->buf[1] == 'E' &&
-        p->buf[2] == 'X' && p->buf[3] == 'A')
+        p->buf[2] == 'X' && p->buf[3] == 'A' &&
+        w && w <= 2048 && h && h <= 2048)
         return AVPROBE_SCORE_MAX;
     else
         return 0;




More information about the ffmpeg-devel mailing list