summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-01-24 16:53:33 -0700
committerAndreas Boll <andreas.boll.dev@gmail.com>2013-02-13 18:46:39 +0100
commit6b745a4e245305aae7b41b246c853a273a397673 (patch)
tree478b55b18aeb52fd2d02f5fa81613710267f2f9d
parent998f402af5b37aadc6dc8adcc19f7b6428ada007 (diff)
svga: add NULL pointer check in svga_create_sampler_state()
Note: This is a candidate for the 9.0 branch. (cherry picked from commit 9227c5374170caccb7ffac85a131971d7d603171)
-rw-r--r--src/gallium/drivers/svga/svga_pipe_sampler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 0d2745e25e..03d604d97c 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -98,6 +98,9 @@ svga_create_sampler_state(struct pipe_context *pipe,
struct svga_context *svga = svga_context(pipe);
struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state );
+ if (!cso)
+ return NULL;
+
cso->mipfilter = translate_mip_filter(sampler->min_mip_filter);
cso->magfilter = translate_img_filter( sampler->mag_img_filter );
cso->minfilter = translate_img_filter( sampler->min_img_filter );