Module: wine Branch: master Commit: 745126b05d4bd2bb6d989574109fd542ac388629 URL: http://source.winehq.org/git/wine.git/?a=commit;h=745126b05d4bd2bb6d98957410...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Nov 15 13:43:35 2010 +0100
wined3d: Properly recreate the sysmem resource location in IWineD3DSurfaceImpl_SetMem().
Otherwise we could end up with surfaces that have SFLAG_INSYSMEM set, but no actual system memory allocated. This was exposed by 3bbe658ef1b2a992ad44cd9503ad65889a1c6896.
---
dlls/wined3d/surface.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 485f255..69a9efd 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2631,10 +2631,13 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_SetMem(IWineD3DSurface *iface, void *M /* HeapMemory should be NULL already */ if (This->resource.heapMemory) ERR("User pointer surface has heap memory allocated.\n"); - This->flags &= ~SFLAG_USERPTR; + This->flags &= ~(SFLAG_USERPTR | SFLAG_INSYSMEM);
if (This->flags & SFLAG_CLIENT) surface_release_client_storage(This); + + surface_prepare_system_memory(This); + surface_modify_location(This, SFLAG_INSYSMEM, TRUE); } return WINED3D_OK; }