diff options
author | Brian <[email protected]> | 2008-01-22 21:11:55 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-22 21:11:55 -0700 |
commit | 2a077500a84819d1e6ac62e84ded130aa655c5e9 (patch) | |
tree | e16cbba8051acc5ee5fc4409e5697e11d0041989 /src/mesa/main | |
parent | e1ae5b89fce51ce1138a5cbe93caa0e1fccf219f (diff) |
Fix some issues with glDrawBuffer(GL_NONE), bug 14198
Set _ColorDrawBuffers[0] = NULL if no renderbuffers enabled.
Check that _ColorDrawBuffers[0] is non-null before dereferencing in a few places.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/framebuffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 06a34574881..d62af98f8a1 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -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) { |