[Bug 7643] Supreme Commander crashes during play

Wine Bugs wine-bugs at winehq.org
Sun Mar 11 15:38:11 CDT 2007


http://bugs.winehq.org/show_bug.cgi?id=7643





------- Additional Comments From ehoover at mines.edu  2007-11-03 15:38 -------
Created an attachment (id=5306)
 --> (http://bugs.winehq.org/attachment.cgi?id=5306&action=view)
Managing to build things

The attached screenshot shows the game getting much further than usual.  By
hacking IWineD3DSurfaceImpl_LockRect in wined3d/surface.c to allocate more
memory, you can actually create some buildings and units in the campaign.  The
problem appears to be related to this:

This->resource.allocatedMemory = HeapAlloc(GetProcessHeap() ,0 ,
This->resource.size + 4);
...
pLockedRect->pBits = This->resource.allocatedMemory + (pLockedRect->Pitch *
pRect->top) + (pRect->left * This->bytesPerPixel);

LockRect allows this allocation of pBits to be greater than the allocated
memory size.  Since there is not even a check to see if the value of pBits is
OK, there is no indication of a problem until Supreme Commander tries to use
that memory location and segfaults.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list