Alexandre Julliard : user32: Ignore PNG icons instead of failing if we don 't have libpng.
Alexandre Julliard
julliard at winehq.org
Tue Apr 3 15:39:06 CDT 2018
Module: wine
Branch: master
Commit: 9dc886244bcc21468c88f4951bb875155c0df242
URL: https://source.winehq.org/git/wine.git/?a=commit;h=9dc886244bcc21468c88f4951bb875155c0df242
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Apr 3 20:41:58 2018 +0200
user32: Ignore PNG icons instead of failing if we don't have libpng.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/cursoricon.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c
index 7730736..a6daa48 100644
--- a/dlls/user32/cursoricon.c
+++ b/dlls/user32/cursoricon.c
@@ -409,6 +409,13 @@ static BITMAPINFO *load_png(const char *png_data, DWORD *size)
#else /* SONAME_LIBPNG */
+static BOOL have_libpng(void)
+{
+ static int warned;
+ if (!warned++) WARN( "PNG support not compiled in\n" );
+ return FALSE;
+}
+
static BOOL get_png_info(const void *png_data, DWORD size, int *width, int *height, int *bpp)
{
return FALSE;
@@ -997,7 +1004,11 @@ static BOOL CURSORICON_GetFileEntry( LPCVOID dir, DWORD size, int n,
info = (const BITMAPINFOHEADER *)((const char *)dir + entry->dwDIBOffset);
if (info->biSize == PNG_SIGN)
- return get_png_info(info, size, width, height, bits);
+ {
+ if (have_libpng()) return get_png_info(info, size, width, height, bits);
+ *width = *height = *bits = 0;
+ return TRUE;
+ }
if (info->biSize != sizeof(BITMAPCOREHEADER))
{
More information about the wine-cvs
mailing list