[PATCH 3/6] wined3d: Don't return the BO address offset if glMapBuffer() fails.

Zebediah Figura zfigura at codeweavers.com
Tue Nov 30 17:55:19 CST 2021


From: Henri Verbeet <hverbeet at codeweavers.com>

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/wined3d/context_gl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c
index 0b0d594b4b1..675c26ac6fe 100644
--- a/dlls/wined3d/context_gl.c
+++ b/dlls/wined3d/context_gl.c
@@ -2716,8 +2716,8 @@ map:
     }
     else
     {
-        map_ptr = GL_EXTCALL(glMapBuffer(bo->binding, wined3d_resource_gl_legacy_map_flags(flags)));
-        map_ptr += offset;
+        if ((map_ptr = GL_EXTCALL(glMapBuffer(bo->binding, wined3d_resource_gl_legacy_map_flags(flags)))))
+            map_ptr += offset;
     }
 
     wined3d_context_gl_bind_bo(context_gl, bo->binding, 0);
-- 
2.32.0




More information about the wine-devel mailing list