winemac: Clamp the number of colors to <= 256 in bitmap_info_size().

… as is done in user32's and gdi32's version of the same function.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Ken Thomases 2016-10-23 13:03:26 -05:00 committed by Alexandre Julliard
parent 8b75e66a5b
commit 12ea83acb5
1 changed files with 1 additions and 1 deletions

View File

@ -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;