[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 10:24:45 CEST 2014
On Friday 04 July 2014 09:51:36 am Carl Eugen Hoyos wrote:
> Attached patch fixes image-samples/bmp-files/11Bios13.bmp
New patch attached.
Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c
index 47ff978..2eb22b1 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 = FFMIN(256, (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