From 9227c5374170caccb7ffac85a131971d7d603171 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Jan 2013 16:53:33 -0700 Subject: svga: add NULL pointer check in svga_create_sampler_state() Note: This is a candidate for the 9.0 branch. --- src/gallium/drivers/svga/svga_pipe_sampler.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/drivers/svga/svga_pipe_sampler.c') diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index 0d2745e25ef..03d604d97c5 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 ); -- cgit v1.2.3