From: Brian Paul Date: Thu, 23 Jan 2014 16:47:34 +0000 (-0700) Subject: st/mesa: fix glReadBuffer(GL_NONE) segfault X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7c118ffbfdafaccd4ec05d4a040d07e120c5090;p=mesa.git st/mesa: fix glReadBuffer(GL_NONE) segfault Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956 Cc: 10.0 Tested-by: Ahmed Allam Reviewed-by: Marek Olšák --- 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); }