From 530b9910c2fd25344e6d28b6d9aa0eaad31618e7 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 11 Mar 2010 15:30:21 +0100 Subject: gallium: Check for OOM condition when creating a sampler view. --- src/gallium/drivers/svga/svga_pipe_sampler.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gallium/drivers/svga') diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index ebd1b949972..82d525ca33f 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -183,11 +183,13 @@ svga_create_sampler_view(struct pipe_context *pipe, { struct pipe_sampler_view *view = CALLOC_STRUCT(pipe_sampler_view); - *view = *templ; - view->reference.count = 1; - view->texture = NULL; - pipe_texture_reference(&view->texture, texture); - view->context = pipe; + if (view) { + *view = *templ; + view->reference.count = 1; + view->texture = NULL; + pipe_texture_reference(&view->texture, texture); + view->context = pipe; + } return view; } -- cgit v1.2.3