From 12ea83acb501dc7a9641b7f8d2f5419a2637c5fb Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Sun, 23 Oct 2016 13:03:26 -0500 Subject: [PATCH] winemac: Clamp the number of colors to <= 256 in bitmap_info_size(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit … as is done in user32's and gdi32's version of the same function. Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- dlls/winemac.drv/clipboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/winemac.drv/clipboard.c b/dlls/winemac.drv/clipboard.c index 15f09928b01..4c66b9ffa6c 100644 --- a/dlls/winemac.drv/clipboard.c +++ b/dlls/winemac.drv/clipboard.c @@ -395,7 +395,7 @@ static int bitmap_info_size(const BITMAPINFO *info, WORD coloruse) } else /* assume BITMAPINFOHEADER */ { - colors = info->bmiHeader.biClrUsed; + colors = MIN(info->bmiHeader.biClrUsed, 256); if (!colors && (info->bmiHeader.biBitCount <= 8)) colors = 1 << info->bmiHeader.biBitCount; if (info->bmiHeader.biCompression == BI_BITFIELDS) masks = 3; -- 2.11.4.GIT