[FFmpeg-devel] [PATCH]Use os/2 palette even if it contains less than 256 entries

Carl Eugen Hoyos cehoyos at ag.or.at
Fri Jul 4 09:51:36 CEST 2014


Hi!

Attached patch fixes image-samples/bmp-files/11Bios13.bmp

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index 47ff978..c793a2c 100644
--- a/libavcodec/bmp.c
+++ b/libavcodec/bmp.c
@@ -247,6 +247,8 @@ static int bmp_decode_frame(AVCodecContext *avctx,
             } else if (t) {
                 colors = t;
             }
+        } else {
+            colors = (hsize-ihsize-14) / 3;
         }
         buf = buf0 + 14 + ihsize; //palette location
         // OS/2 bitmap, 3 bytes per palette entry


More information about the ffmpeg-devel mailing list