OSDN Git Service
(root)
/
android-x86
/
external-mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5d0e136
)
llvmpipe: add out of memory checking to triangle setup path
author
Brian Paul
<brianp@vmware.com>
Fri, 28 May 2010 18:49:49 +0000
(12:49 -0600)
committer
Brian Paul
<brianp@vmware.com>
Fri, 28 May 2010 18:52:41 +0000
(12:52 -0600)
src/gallium/drivers/llvmpipe/lp_setup_tri.c
patch
|
blob
|
history
diff --git
a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index
306cb6e
..
34d7125
100644
(file)
--- a/
src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/
src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@
-272,12
+272,14
@@
alloc_triangle(struct lp_scene *scene, unsigned nr_inputs, unsigned *tri_size)
tri = lp_scene_alloc_aligned( scene, bytes, 16 );
tri = lp_scene_alloc_aligned( scene, bytes, 16 );
- inputs = (char *) (tri + 1);
- tri->inputs.a0 = (float (*)[4]) inputs;
- tri->inputs.dadx = (float (*)[4]) (inputs + input_array_sz);
- tri->inputs.dady = (float (*)[4]) (inputs + 2 * input_array_sz);
+ if (tri) {
+ inputs = (char *) (tri + 1);
+ tri->inputs.a0 = (float (*)[4]) inputs;
+ tri->inputs.dadx = (float (*)[4]) (inputs + input_array_sz);
+ tri->inputs.dady = (float (*)[4]) (inputs + 2 * input_array_sz);
- *tri_size = bytes;
+ *tri_size = bytes;
+ }
return tri;
}
return tri;
}
@@
-341,6
+343,8
@@
do_triangle_ccw(struct lp_setup_context *setup,
print_triangle(setup, v1, v2, v3);
tri = alloc_triangle(scene, setup->fs.nr_inputs, &tri_bytes);
print_triangle(setup, v1, v2, v3);
tri = alloc_triangle(scene, setup->fs.nr_inputs, &tri_bytes);
+ if (!tri)
+ return;
#ifdef DEBUG
tri->v[0][0] = v1[0][0];
#ifdef DEBUG
tri->v[0][0] = v1[0][0];