mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 00:30:11 +01:00
zink: fix dereference before NULL check
The `sv->image_view` pointer is dereference before checking whether it's
NULL or not.
Check for NULL before dereferencing it to avoid a possible crash.
Fixes: 9de455bc43 ("zink: check for sampler view existence during
zink_rebind_all_images()")
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: José Expósito <jexposit@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26140>
This commit is contained in:
parent
ec82b42944
commit
83ed419cd0
1 changed files with 1 additions and 1 deletions
|
|
@ -4878,7 +4878,7 @@ zink_rebind_all_images(struct zink_context *ctx)
|
|||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
for (unsigned j = 0; j < ctx->di.num_sampler_views[i]; j++) {
|
||||
struct zink_sampler_view *sv = zink_sampler_view(ctx->sampler_views[i][j]);
|
||||
if (!sv || sv->image_view->base.texture->target == PIPE_BUFFER || !sv->image_view)
|
||||
if (!sv || !sv->image_view || sv->image_view->base.texture->target == PIPE_BUFFER)
|
||||
continue;
|
||||
struct zink_resource *res = zink_resource(sv->image_view->base.texture);
|
||||
if (res->obj != sv->image_view->obj) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue