mesa/st: check buf before dereferencing it
It can be NULL. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36411>
This commit is contained in:
committed by
Marge Bot
parent
e92638b6bf
commit
a3c0632342
@@ -198,11 +198,12 @@ st_feedback_draw_vbo(struct gl_context *ctx,
|
||||
struct gl_buffer_binding *binding =
|
||||
&st->ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding];
|
||||
struct gl_buffer_object *st_obj = binding->BufferObject;
|
||||
struct pipe_resource *buf = st_obj->buffer;
|
||||
|
||||
if (!buf)
|
||||
if (!st_obj || !st_obj->buffer)
|
||||
continue;
|
||||
|
||||
struct pipe_resource *buf = st_obj->buffer;
|
||||
|
||||
unsigned offset = binding->Offset;
|
||||
unsigned size = buf->width0 - offset;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user