]> git.sesse.net Git - ffmpeg/commitdiff
get_pix_fmt_score: favor equal formats if all else equal
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 29 Jun 2013 20:20:20 +0000 (22:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 29 Jun 2013 20:20:20 +0000 (22:20 +0200)
Fixes Ticket2578

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/imgconvert.c

index 6da531c6588a212e6d89a254a23cd684e939c4f9..a2bcdbcca79b10aad1c377369fad0a36c4320435 100644 (file)
@@ -113,7 +113,7 @@ static int get_pix_fmt_score(enum AVPixelFormat dst_pix_fmt,
     int src_color, dst_color;
     int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth;
     int ret, loss, i, nb_components;
-    int score = INT_MAX;
+    int score = INT_MAX - 1;
 
     if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE)
         return ~0;