From f7c118ffbfdafaccd4ec05d4a040d07e120c5090 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 23 Jan 2014 09:47:34 -0700 Subject: st/mesa: fix glReadBuffer(GL_NONE) segfault MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956 Cc: 10.0 Tested-by: Ahmed Allam Reviewed-by: Marek Olšák --- src/mesa/state_tracker/st_cb_fbo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/state_tracker') 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); } -- cgit v1.2.3