[Mesa-dev] [PATCH] st/mesa: fix glReadBuffer(GL_NONE) segfault

Brian Paul brianp at vmware.com
Thu Jan 23 08:50:36 PST 2014


Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73956
Cc: 10.0 <mesa-stable at lists.freedesktop.org>
Tested-by: Ahmed Allam <ahmabdabd at hotmail.com>
---
 src/mesa/state_tracker/st_cb_fbo.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 637f7ee..eca04b8 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);
 }
 
 
-- 
1.7.10.4



More information about the mesa-dev mailing list