svga: add null ptr check in svga_get_tex_sampler_view()
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 efbc13899a4271548bf70b216a70c7c2f9c6ea9d..1950784a15a3fb112f4f7021005d6819b7a4d78e 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