USER32: stop PrivateExtractIcons from crashing given an invalid icon index

Mike McCormack mike at codeweavers.com
Sun Jul 11 18:11:55 CDT 2004


This crash occurs with the Enterprise Architect evaluation version from
http://www.sparxsystems.com.au/ea.htm

Mike


ChangeLog:
* stop PrivateExtractIcons from crashing given an invalid icon index
-------------- next part --------------
Index: dlls/user/exticon.c
===================================================================
RCS file: /home/wine/wine/dlls/user/exticon.c,v
retrieving revision 1.31
diff -u -r1.31 exticon.c
--- dlls/user/exticon.c	27 Jan 2004 00:01:43 -0000	1.31
+++ dlls/user/exticon.c	11 Jul 2004 23:07:44 -0000
@@ -543,6 +543,12 @@
 	  {
 	    const IMAGE_RESOURCE_DIRECTORY *xresdir;
 	    xresdir = find_entry_by_id(iconresdir, LOWORD(pIconId[i]), rootresdir);
+            if( !xresdir )
+            {
+              WARN("icon entry %d not found\n", LOWORD(pIconId[i]));
+	      RetPtr[i]=0;
+	      continue;
+            }
 	    xresdir = find_entry_default(xresdir, rootresdir);
 	    idataent = (PIMAGE_RESOURCE_DATA_ENTRY)xresdir;
 	    idata = NULL;


More information about the wine-patches mailing list