Bug 682688 - FF6 Fix for moz-icon invalid generated icons. r=joe

This commit is contained in:
Brian R. Bondy 2011-08-30 01:44:04 -04:00
parent f4562760b6
commit a253ceb3d3

View File

@ -452,10 +452,15 @@ static int GetColorTableSize(BITMAPINFOHEADER* aHeader)
}
case 16:
case 32:
if (aHeader->biCompression == BI_RGB)
// If we have BI_BITFIELDS compression, we would normally need 3 DWORDS for
// the bitfields mask which would be stored in the color table; However,
// we instead force the bitmap to request data of type BI_RGB so the color
// table should be of size 0.
// Setting aHeader->biCompression = BI_RGB forces the later call to
// GetDIBits to return to us BI_RGB data.
if (aHeader->biCompression == BI_BITFIELDS)
aHeader->biCompression = BI_RGB;
colorTableSize = 0;
else if (aHeader->biCompression == BI_BITFIELDS)
colorTableSize = 3 * sizeof(DWORD);
break;
case 24:
colorTableSize = 0;