Commit b34f04f9 authored by Damjan Jovanovic's avatar Damjan Jovanovic Committed by Alexandre Julliard

windowscodecs: Fix ICO palette size calculation.

parent 234afb88
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment