[FFmpeg-devel] [PATCH]lavf/img2: Only autodetect valid Quickdraw images

Carl Eugen Hoyos cehoyos at ag.or.at
Tue May 19 11:58:47 CEST 2015


Hi!

Attached patch improves the Quickdraw autodetection.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 0830f00..ec234d1 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -714,8 +714,10 @@ static int qdraw_probe(AVProbeData *p)
 {
     const uint8_t *b = p->buf;
 
-    if (!b[10] && AV_RB32(b+11) == 0x1102ff0c && !b[15] ||
-        p->buf_size >= 528 && !b[522] && AV_RB32(b+523) == 0x1102ff0c && !b[527])
+    if (   p->buf_size >= 528
+        && (AV_RB64(b + 520) & 0xFFFFFFFFFFFF) == 0x001102ff0c00
+        && AV_RB16(b + 520)
+        && AV_RB16(b + 518))
         return AVPROBE_SCORE_EXTENSION + 1;
     return 0;
 }


More information about the ffmpeg-devel mailing list