Mesa (master): svga: add null ptr check in svga_get_tex_sampler_view()

Brian Paul brianp at kemper.freedesktop.org
Sat Jun 22 14:52:23 UTC 2013


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

Author: Brian Paul <brianp at vmware.com>
Date:   Fri Jun 21 16:09:05 2013 -0600

svga: add null ptr check in svga_get_tex_sampler_view()

Trivial.

---

 src/gallium/drivers/svga/svga_sampler_view.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_sampler_view.c b/src/gallium/drivers/svga/svga_sampler_view.c
index efbc138..1950784 100644
--- a/src/gallium/drivers/svga/svga_sampler_view.c
+++ b/src/gallium/drivers/svga/svga_sampler_view.c
@@ -103,6 +103,9 @@ svga_get_tex_sampler_view(struct pipe_context *pipe,
    }
 
    sv = CALLOC_STRUCT(svga_sampler_view);
+   if (!sv)
+      return NULL;
+
    pipe_reference_init(&sv->reference, 1);
 
    /* Note: we're not refcounting the texture resource here to avoid




More information about the mesa-commit mailing list