windowscodecs: Fix ICO palette size calculation.

This commit is contained in:
Damjan Jovanovic 2010-05-22 07:57:54 +02:00 committed by Alexandre Julliard
parent 234afb88e8
commit b34f04f9c4
1 changed files with 1 additions and 1 deletions

View File

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