From: Eric Anholt Date: Fri, 15 Feb 2008 21:48:11 +0000 (-0800) Subject: [intel] Allow attIndex to be negative to avoid defeating the >= 0 check. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c741d287ecce1bd95d4e024d60e274abfcfbe22f;p=mesa.git [intel] Allow attIndex to be negative to avoid defeating the >= 0 check. Otherwise, we would go wildly out of bounds if passed -1 (no renderbuffer), such as while doing LOCK_HARDWARE with glDrawBuffer(GL_NONE). --- diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index c430e90382f..94d499f001c 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -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); diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 2fda7dca005..c90c84b48c2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -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);