summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-01-23 09:47:34 -0700
committerBrian Paul <[email protected]>2014-01-23 11:08:40 -0700
commitf7c118ffbfdafaccd4ec05d4a040d07e120c5090 (patch)
tree1c7ac5a97860ca6be8cbe4196a76c6d507d11be7 /src/mesa
parent349efdbba141dc64a2b8f6beb481b9f3d7da6d7d (diff)
st/mesa: fix glReadBuffer(GL_NONE) segfault
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956 Cc: 10.0 <[email protected]> Tested-by: Ahmed Allam <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-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);
}