summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2014-01-23 09:47:34 -0700
committerBrian Paul <brianp@vmware.com>2014-01-23 11:08:40 -0700
commitf7c118ffbfdafaccd4ec05d4a040d07e120c5090 (patch)
tree1c7ac5a97860ca6be8cbe4196a76c6d507d11be7
parent349efdbba141dc64a2b8f6beb481b9f3d7da6d7d (diff)
st/mesa: fix glReadBuffer(GL_NONE) segfault
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956 Cc: 10.0 <mesa-stable@lists.freedesktop.org> Tested-by: Ahmed Allam <ahmabdabd@hotmail.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 637f7ee9897..eca04b89b5a 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -700,7 +700,8 @@ st_ReadBuffer(struct gl_context *ctx, GLenum buffer)
(void) buffer;
/* add the renderbuffer on demand */
- st_manager_add_color_renderbuffer(st, fb, fb->_ColorReadBufferIndex);
+ if (fb->_ColorReadBufferIndex >= 0)
+ st_manager_add_color_renderbuffer(st, fb, fb->_ColorReadBufferIndex);
}