Module: Mesa
Branch: master
Commit: c8769ff8dd2eb9c9698f9608f97256708d6f1009
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8769ff8dd2eb9c9698f9608f97256708d6f1009

Author: Erik Faye-Lund <[email protected]>
Date:   Wed Nov 27 17:38:53 2019 +0100

zink: avoid NULL-deref

Same story as the previous two commits; these functions dereference the
memory they are pointed at. We can't do that.

CoverityID: 1455180
Reviewed-by: Dave Airlie <[email protected]>

---

 src/gallium/drivers/zink/zink_batch.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_batch.c 
b/src/gallium/drivers/zink/zink_batch.c
index c31e175d6d6..a73128d4993 100644
--- a/src/gallium/drivers/zink/zink_batch.c
+++ b/src/gallium/drivers/zink/zink_batch.c
@@ -113,8 +113,7 @@ zink_batch_reference_sampler_view(struct zink_batch *batch,
 {
    struct set_entry *entry = _mesa_set_search(batch->sampler_views, sv);
    if (!entry) {
-      struct pipe_sampler_view *tmp = NULL;
       entry = _mesa_set_add(batch->sampler_views, sv);
-      pipe_sampler_view_reference(&tmp, &sv->base);
+      pipe_reference(NULL, &sv->base.reference);
    }
 }

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to