aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-11-14 08:27:13 -0700
committerBrian Paul <[email protected]>2011-11-15 07:49:26 -0700
commitd0836eda5e7d8e9093c1975ef545e3b3deb287a1 (patch)
tree8c3f81eea82eba3c2404f3a8097fe2c16814fdeb /src/mesa
parent438d7ac146dc89d1c2943610c662c57e11a47382 (diff)
st/mesa: check for missing VBO in setup_interleaved_attribs()
This fixes a crash with the piglit vbo-too-small test. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_draw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c
index f2fbf483694..cb518e1afb3 100644
--- a/src/mesa/state_tracker/st_draw.c
+++ b/src/mesa/state_tracker/st_draw.c
@@ -436,8 +436,8 @@ setup_interleaved_attribs(struct gl_context *ctx,
/* all interleaved arrays in a VBO */
struct st_buffer_object *stobj = st_buffer_object(bufobj);
- if (!stobj) {
- /* probably out of memory */
+ if (!stobj || !stobj->buffer) {
+ /* probably out of memory (or zero-sized buffer) */
return GL_FALSE;
}
@@ -505,7 +505,7 @@ setup_non_interleaved_attribs(struct gl_context *ctx,
struct st_buffer_object *stobj = st_buffer_object(bufobj);
if (!stobj || !stobj->buffer) {
- /* probably ran out of memory */
+ /* probably out of memory (or zero-sized buffer) */
return GL_FALSE;
}