[intel] Allow attIndex to be negative to avoid defeating the >= 0 check.
authorEric Anholt <eric@anholt.net>
Fri, 15 Feb 2008 21:48:11 +0000 (13:48 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 15 Feb 2008 21:48:11 +0000 (13:48 -0800)
Otherwise, we would go wildly out of bounds if passed -1 (no renderbuffer), such
as while doing LOCK_HARDWARE with glDrawBuffer(GL_NONE).

src/mesa/drivers/dri/intel/intel_fbo.c
src/mesa/drivers/dri/intel/intel_fbo.h

index c430e90382f693f8320bf0c859124fe5085b3e28..94d499f001cde9674cffebdce620eb2c655e4ecd 100644 (file)
@@ -69,7 +69,7 @@ intel_renderbuffer(struct gl_renderbuffer *rb)
 
 
 struct intel_renderbuffer *
-intel_get_renderbuffer(struct gl_framebuffer *fb, GLuint attIndex)
+intel_get_renderbuffer(struct gl_framebuffer *fb, int attIndex)
 {
    if (attIndex >= 0)
       return intel_renderbuffer(fb->Attachment[attIndex].Renderbuffer);
index 2fda7dca005ec31aa856844d6bec8b536382e5f1..c90c84b48c287233b29d992aef40bb2488efa4c7 100644 (file)
@@ -98,7 +98,7 @@ extern void intel_fbo_init(struct intel_context *intel);
 /* XXX make inline or macro */
 extern struct intel_renderbuffer *intel_get_renderbuffer(struct gl_framebuffer
                                                          *fb,
-                                                         GLuint attIndex);
+                                                         int attIndex);
 
 extern void intel_flip_renderbuffers(struct intel_framebuffer *intel_fb);