lavf/img2dec: Reduce the probe score for incomplete jpgs.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 27 Jan 2017 07:31:07 +0000 (08:31 +0100)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 27 Jan 2017 07:31:07 +0000 (08:31 +0100)
Ensures that probing doesn't finish prematurely for small files.

libavformat/img2dec.c

index 321189f..c3c2cf3 100644 (file)
@@ -756,7 +756,7 @@ static int jpeg_probe(AVProbeData *p)
     if (state == EOI)
         return AVPROBE_SCORE_EXTENSION + 1;
     if (state == SOS)
-        return AVPROBE_SCORE_EXTENSION / 2 + 1;
+        return AVPROBE_SCORE_EXTENSION / 2;
     return AVPROBE_SCORE_EXTENSION / 8;
 }