Lasse Rasinen : d3d9: Update locked_rect only if wined3d_surface_map succeeds.

Alexandre Julliard julliard at winehq.org
Fri Jan 10 14:44:55 CST 2014


Module: wine
Branch: stable
Commit: d84188656c947670c0e668345aa7c09a5d5e52c9
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d84188656c947670c0e668345aa7c09a5d5e52c9

Author: Lasse Rasinen <lrasinen at iki.fi>
Date:   Mon Oct 28 18:48:17 2013 +0200

d3d9: Update locked_rect only if wined3d_surface_map succeeds.

(cherry picked from commit eeefed3dd02f5299e38d308ee6d9ba6998722bdd)

---

 dlls/d3d9/surface.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d9/surface.c b/dlls/d3d9/surface.c
index a031c6e..419be07 100644
--- a/dlls/d3d9/surface.c
+++ b/dlls/d3d9/surface.c
@@ -293,8 +293,11 @@ static HRESULT WINAPI d3d9_surface_LockRect(IDirect3DSurface9 *iface,
     hr = wined3d_surface_map(surface->wined3d_surface, &map_desc, rect, flags);
     wined3d_mutex_unlock();
 
-    locked_rect->Pitch = map_desc.row_pitch;
-    locked_rect->pBits = map_desc.data;
+    if (SUCCEEDED(hr))
+    {
+        locked_rect->Pitch = map_desc.row_pitch;
+        locked_rect->pBits = map_desc.data;
+    }
 
     return hr;
 }




More information about the wine-cvs mailing list