diff options
author | Brian Paul <[email protected]> | 2013-01-24 16:32:42 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-01-25 15:41:41 -0700 |
commit | 7a89f08a22eb83ed2f0c51e516397d6415e64a3d (patch) | |
tree | ff6eea2c5f4afc7f3c10a80e370c488db7fe4173 /src/mesa/vbo/vbo_exec_api.c | |
parent | b13c534f1479549e53b9896ea4d25d79f8466c24 (diff) |
vbo: add a null pointer check to handle OOM instead of crashing
Note: This is a candidate for the 9.0 branch.
Diffstat (limited to 'src/mesa/vbo/vbo_exec_api.c')
-rw-r--r-- | src/mesa/vbo/vbo_exec_api.c | 5 |
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 985f2209c10..353f8cfde34 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); |