From b34f04f9c4204fa777412c8d636c5501438b44c4 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Sat, 22 May 2010 07:57:54 +0200 Subject: [PATCH] windowscodecs: Fix ICO palette size calculation. --- dlls/windowscodecs/icoformat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/windowscodecs/icoformat.c b/dlls/windowscodecs/icoformat.c index 180dbb33888..8012b4e1ae7 100644 --- a/dlls/windowscodecs/icoformat.c +++ b/dlls/windowscodecs/icoformat.c @@ -192,7 +192,7 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) if (bih.biBitCount <= 8) { /* read the palette */ - colorcount = This->entry.bColorCount ? This->entry.bColorCount : 256; + colorcount = bih.biClrUsed ? bih.biClrUsed : 1 << bih.biBitCount; hr = IStream_Read(This->parent->stream, colors, sizeof(RGBQUAD)*colorcount, &bytesread); if (FAILED(hr) || bytesread != sizeof(RGBQUAD)*colorcount) goto fail; -- 2.11.4.GIT