summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2013-01-24 16:32:42 -0700
committerAndreas Boll <andreas.boll.dev@gmail.com>2013-02-13 18:46:39 +0100
commit3fa0423c0230154c80d8f45d3232acc10b6e2014 (patch)
tree3af816d1b440f3636d84aacc23d72d3029096e5c
parent6b745a4e245305aae7b41b246c853a273a397673 (diff)
vbo: add a null pointer check to handle OOM instead of crashing
Note: This is a candidate for the 9.0 branch. (cherry picked from commit 7a89f08a22eb83ed2f0c51e516397d6415e64a3d)
-rw-r--r--src/mesa/vbo/vbo_exec_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c
index 64762c7d4a..a02f0b2f2e 100644
--- a/src/mesa/vbo/vbo_exec_api.c
+++ b/src/mesa/vbo/vbo_exec_api.c
@@ -124,6 +124,11 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec )
*/
vbo_exec_wrap_buffers( exec );
+ if (!exec->vtx.buffer_ptr) {
+ /* probably ran out of memory earlier when allocating the VBO */
+ return;
+ }
+
/* Copy stored stored vertices to start of new list.
*/
assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr);