summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-10-17 18:48:11 -0700
committerKeith Whitwell <keithw@vmware.com>2010-10-17 18:48:11 -0700
commitca2b2ac131933b4171b519813df1aaa3a81621cd (patch)
treeb0bb1ea9ec2efbabba999dd371b3ce2dbacebad8 /src
parent4dfb43c6a655574a9b59b552d05408c027d8cfaa (diff)
llvmpipe: fail cleanly on malloc failure in lp_setup_alloc_triangle
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index c6cb9afda4..15c414d8c3 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -86,9 +86,10 @@ lp_setup_alloc_triangle(struct lp_scene *scene,
plane_sz);
tri = lp_scene_alloc_aligned( scene, *tri_size, 16 );
- if (tri) {
- tri->inputs.stride = input_array_sz;
- }
+ if (tri == NULL)
+ return NULL;
+
+ tri->inputs.stride = input_array_sz;
{
char *a = (char *)tri;
@@ -96,7 +97,6 @@ lp_setup_alloc_triangle(struct lp_scene *scene,
assert(b - a == *tri_size);
}
-
return tri;
}