svga: add null ptr check in svga_get_tex_sampler_view() 89/7089/1
authorBrian Paul <brianp@vmware.com>
Fri, 21 Jun 2013 22:09:05 +0000 (16:09 -0600)
committerBrian Paul <brianp@vmware.com>
Sat, 22 Jun 2013 14:49:09 +0000 (08:49 -0600)
Trivial.

src/gallium/drivers/svga/svga_sampler_view.c

index efbc138..1950784 100644 (file)
@@ -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