[PATCH] wined3d: Do not attempt to bind a null buffer_object in state_cb().

Conor McCarthy cmccarthy at codeweavers.com
Tue Dec 14 01:04:52 CST 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=52020
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
 dlls/wined3d/state.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 865c60d18..6d7e30732 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4584,13 +4584,12 @@ static void state_cb(struct wined3d_context *context, const struct wined3d_state
     {
         const struct wined3d_constant_buffer_state *buffer_state = &state->cb[shader_type][i];
 
-        if (!buffer_state->buffer)
+        if (!(buffer = buffer_state->buffer) || !buffer->buffer_object)
         {
             GL_EXTCALL(glBindBufferBase(GL_UNIFORM_BUFFER, base + i, 0));
             continue;
         }
 
-        buffer = buffer_state->buffer;
         bo_gl = wined3d_bo_gl(buffer->buffer_object);
         GL_EXTCALL(glBindBufferRange(GL_UNIFORM_BUFFER, base + i,
                 bo_gl->id, bo_gl->b.buffer_offset + buffer_state->offset, buffer_state->size));
-- 
2.33.0




More information about the wine-devel mailing list