Fix some issues with glDrawBuffer(GL_NONE), bug 14198
[mesa.git] / src / mesa / main / framebuffer.c
index 06a3457488158de24d3e59d9acf94eaf92beec84..d62af98f8a1d89b4c3d3724e0fe1b58dfac645ea 100644 (file)
@@ -641,6 +641,9 @@ update_color_draw_buffers(GLcontext *ctx, struct gl_framebuffer *fb)
 {
    GLuint output;
 
+   /* set 0th buffer to NULL now in case _NumColorDrawBuffers is zero */
+   fb->_ColorDrawBuffers[0] = NULL;
+
    for (output = 0; output < fb->_NumColorDrawBuffers; output++) {
       GLint buf = fb->_ColorDrawBufferIndexes[output];
       if (buf >= 0) {