Commit 745126b0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

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 3bbe658e.
parent 44b9712c
......@@ -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;
}
......
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