Commit 6a36802f authored by Vincent Povirk's avatar Vincent Povirk Committed by Alexandre Julliard

windowscodecs: Use the BITMAPINFOHEADER structure to get icon bitcount.

parent dbf123ba
...@@ -189,7 +189,7 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) ...@@ -189,7 +189,7 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This)
hr = IStream_Read(This->parent->stream, &bih, sizeof(BITMAPINFOHEADER), &bytesread); hr = IStream_Read(This->parent->stream, &bih, sizeof(BITMAPINFOHEADER), &bytesread);
if (FAILED(hr) || bytesread != sizeof(BITMAPINFOHEADER)) goto fail; if (FAILED(hr) || bytesread != sizeof(BITMAPINFOHEADER)) goto fail;
if (This->entry.wBitCount <= 8) if (bih.biBitCount <= 8)
{ {
/* read the palette */ /* read the palette */
colorcount = This->entry.bColorCount ? This->entry.bColorCount : 256; colorcount = This->entry.bColorCount ? This->entry.bColorCount : 256;
...@@ -202,7 +202,7 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) ...@@ -202,7 +202,7 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This)
bitsSize = bitsStride * height; bitsSize = bitsStride * height;
/* read the XOR data */ /* read the XOR data */
switch (This->entry.wBitCount) switch (bih.biBitCount)
{ {
case 1: case 1:
{ {
...@@ -440,11 +440,11 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This) ...@@ -440,11 +440,11 @@ static HRESULT IcoFrameDecode_ReadPixels(IcoFrameDecode *This)
break; break;
} }
default: default:
FIXME("unsupported bitcount: %u\n", This->entry.wBitCount); FIXME("unsupported bitcount: %u\n", bih.biBitCount);
goto fail; goto fail;
} }
if (This->entry.wBitCount < 32) if (bih.biBitCount < 32)
{ {
/* set alpha data based on the AND mask */ /* set alpha data based on the AND mask */
UINT andBytesPerRow = (width+31)/32*4; UINT andBytesPerRow = (width+31)/32*4;
......
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