diff options
author | Michal Krol <michal@vmware.com> | 2010-03-11 15:30:21 +0100 |
---|---|---|
committer | Michal Krol <michal@vmware.com> | 2010-03-11 15:30:21 +0100 |
commit | 530b9910c2fd25344e6d28b6d9aa0eaad31618e7 (patch) | |
tree | 49633cd9042271cf105c35c3367cab315d000917 /src/gallium/drivers/llvmpipe | |
parent | 252dc5f897f9d124459e3afebf6686d1fe271511 (diff) | |
download | external_mesa3d-530b9910c2fd25344e6d28b6d9aa0eaad31618e7.zip external_mesa3d-530b9910c2fd25344e6d28b6d9aa0eaad31618e7.tar.gz external_mesa3d-530b9910c2fd25344e6d28b6d9aa0eaad31618e7.tar.bz2 |
gallium: Check for OOM condition when creating a sampler view.
Diffstat (limited to 'src/gallium/drivers/llvmpipe')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_state_sampler.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index 2df86a0..2645441 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c @@ -170,11 +170,13 @@ llvmpipe_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; } |