summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2014-01-23 09:47:34 -0700
committerCarl Worth <cworth@cworth.org>2014-01-25 16:52:34 -0800
commit79ef990ef864e43d48d89f4e5ddd050e657841ab (patch)
tree9070b34b73ba03ddd68f4599869fb4a3c577814a /src
parentb1694c9f870f0427addde783c0a4c7091863c2cb (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> (cherry picked from commit f7c118ffbfdafaccd4ec05d4a040d07e120c5090)
Diffstat (limited to 'src')
-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 20894825f7f..62f23a15ec9 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -648,7 +648,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);
}