mirror of
https://github.com/reactos/reactos.git
synced 2025-05-23 19:14:48 +00:00
[USER32] Show Debug Log Message when unhandled PNG found in ICO file. (#5566)
Detect the PNG data in ICO files and print an appropriate message to the debug log. JIRA issue: CORE-19107
This commit is contained in:
parent
88e1675ace
commit
afd39cbc06
1 changed files with 19 additions and 2 deletions
|
@ -179,6 +179,12 @@ static int bitmap_info_size( const BITMAPINFO * info, WORD coloruse )
|
||||||
static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
|
static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
|
||||||
LONG *height, WORD *bpp, DWORD *compr )
|
LONG *height, WORD *bpp, DWORD *compr )
|
||||||
{
|
{
|
||||||
|
#define CR 13
|
||||||
|
#define LF 10
|
||||||
|
#define EOFM 26 // DOS End Of File Marker
|
||||||
|
#define HighBitDetect 0x89 // Byte with high bit set to test if not 7-bit
|
||||||
|
/* wine's definition */
|
||||||
|
static const BYTE png_sig_pattern[] = { HighBitDetect, 'P', 'N', 'G', CR, LF, EOFM, LF };
|
||||||
if (header->biSize == sizeof(BITMAPCOREHEADER))
|
if (header->biSize == sizeof(BITMAPCOREHEADER))
|
||||||
{
|
{
|
||||||
const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)header;
|
const BITMAPCOREHEADER *core = (const BITMAPCOREHEADER *)header;
|
||||||
|
@ -198,7 +204,15 @@ static int DIB_GetBitmapInfo( const BITMAPINFOHEADER *header, LONG *width,
|
||||||
*compr = header->biCompression;
|
*compr = header->biCompression;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
ERR("(%d): unknown/wrong size for header\n", header->biSize );
|
if (memcmp(&header->biSize, png_sig_pattern, sizeof(png_sig_pattern)) == 0)
|
||||||
|
{
|
||||||
|
ERR("Cannot yet display PNG icons\n");
|
||||||
|
/* for PNG format details see https://en.wikipedia.org/wiki/PNG */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ERR("Unknown/wrong size for header of 0x%x\n", header->biSize );
|
||||||
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1377,7 +1391,10 @@ CURSORICON_LoadFromFileW(
|
||||||
|
|
||||||
/* Do the dance */
|
/* Do the dance */
|
||||||
if(!CURSORICON_GetCursorDataFromBMI(&cursorData, (BITMAPINFO*)(&bits[entry->dwDIBOffset])))
|
if(!CURSORICON_GetCursorDataFromBMI(&cursorData, (BITMAPINFO*)(&bits[entry->dwDIBOffset])))
|
||||||
goto end;
|
{
|
||||||
|
ERR("Failing File is \n '%S'.\n", lpszName);
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
|
|
||||||
hCurIcon = NtUserxCreateEmptyCurObject(FALSE);
|
hCurIcon = NtUserxCreateEmptyCurObject(FALSE);
|
||||||
if(!hCurIcon)
|
if(!hCurIcon)
|
||||||
|
|
Loading…
Reference in a new issue