From 810294ce3d3d9cceb3670a938379e2b2cba6cdc9 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Fri, 4 Jul 2014 21:23:53 +0200 Subject: [PATCH] Use os/2 palette even if it contains less than 256 entries. Fixes 11Bios13.bmp. --- libavcodec/bmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index ec4c467049..458fd0c768 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -248,6 +248,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