From d082417daeb3f8a35a490eb44b6c88463289fa5d Mon Sep 17 00:00:00 2001
From: Brian Paul <brian.paul@tungstengraphics.com>
Date: Wed, 28 Mar 2001 21:36:31 +0000
Subject: check for startX off the right edge of the window

---
 src/mesa/swrast/s_aatritemp.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/mesa')

diff --git a/src/mesa/swrast/s_aatritemp.h b/src/mesa/swrast/s_aatritemp.h
index 5eb2455af6..41ef99cbfb 100644
--- a/src/mesa/swrast/s_aatritemp.h
+++ b/src/mesa/swrast/s_aatritemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_aatritemp.h,v 1.8 2001/03/12 00:48:41 gareth Exp $ */
+/* $Id: s_aatritemp.h,v 1.9 2001/03/28 21:36:31 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -366,6 +366,12 @@
          GLint ix, left, startX = (GLint) (x + xAdj);
          GLuint count, n;
          GLfloat coverage = 0.0F;
+
+         /* make sure we're not past the window edge */
+         if (startX >= ctx->DrawBuffer->_Xmax) {
+            startX = ctx->DrawBuffer->_Xmax - 1;
+         }
+
          /* skip fragments with zero coverage */
          while (startX >= 0) {
             coverage = compute_coveragef(pMin, pMax, pMid, startX, iy);
-- 
cgit v1.2.3