Commit 18522a05 authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

winex11: Free correct pointer when using xf86vm.

After allocation the pointer gets shifted by sizeof(xf86vm_modes), so we have to undo that before calling free. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55909
parent f341a693
......@@ -159,11 +159,12 @@ static void xf86vm_free_modes(DEVMODEW *modes)
if (modes)
{
BYTE *ptr = (BYTE *)modes - sizeof(xf86vm_modes);
assert(modes[0].dmDriverExtra == sizeof(XF86VidModeModeInfo *));
memcpy(&xf86vm_modes, (BYTE *)modes - sizeof(xf86vm_modes), sizeof(xf86vm_modes));
memcpy(&xf86vm_modes, ptr, sizeof(xf86vm_modes));
XFree(xf86vm_modes);
free(ptr);
}
free(modes);
}
static BOOL xf86vm_get_current_mode(x11drv_settings_id id, DEVMODEW *mode)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment