PATCH: fix heap corruption in opengl

Marcus Meissner meissner at suse.de
Sat Jul 2 15:31:40 CDT 2005


Hi,

make check fails in dlls/ddraw/tests/d3d, because a heap allocate
is fed to wrong size. (sizeof(BOOLEAN) is 1 , but ative_lights is a
DWORD array).

Ciao, Marcus

Changelog:
Index: dlls/ddraw/device_opengl.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/device_opengl.c,v
retrieving revision 1.3
diff -u -r1.3 device_opengl.c
--- dlls/ddraw/device_opengl.c	12 Jun 2005 10:43:11 -0000	1.3
+++ dlls/ddraw/device_opengl.c	2 Jul 2005 20:29:42 -0000
@@ -4094,7 +4094,7 @@
     object->max_active_lights = opengl_device_caps.dwMaxActiveLights;
     object->light_parameters = NULL;
     object->active_lights = HeapAlloc(GetProcessHeap(), 0,
-        object->max_active_lights * sizeof(BOOLEAN));
+        object->max_active_lights * sizeof(object->active_lights[0]));
     /* Fill the active light array with ~0, which is used to indicate an
        invalid light index. We don't use 0, because it's a valid light index. */
     for (light=0; light < object->max_active_lights; light++)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20050702/79830e48/attachment.pgp


More information about the wine-patches mailing list