[poppler] splash/SplashXPathScanner.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Fri Mar 14 12:31:08 PDT 2008


 splash/SplashXPathScanner.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c65a66a82259f547927cbb918611bcf4a8e264b2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Mar 14 20:29:53 2008 +0100

    xx0 is non exclusive so that should be < not <=
    
    Fixes several warnings about writes on bad places

diff --git a/splash/SplashXPathScanner.cc b/splash/SplashXPathScanner.cc
index 99a0ce8..6fc7ce7 100644
--- a/splash/SplashXPathScanner.cc
+++ b/splash/SplashXPathScanner.cc
@@ -397,7 +397,7 @@ void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf,
 	for (; xx + 7 <= xx0; xx += 8) {
 	  *p++ = 0x00;
 	}
-	if (xx <= xx0) {
+	if (xx < xx0) {
 	  *p &= 0xff >> (xx0 & 7);
 	}
       }
@@ -406,6 +406,7 @@ void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf,
       }
     }
     xx0 = (*x1 + 1) * splashAASize;
+    if (xx0 > aaBuf->getWidth()) xx0 = aaBuf->getWidth();
     // set [xx, xx0) to 0
     if (xx < xx0) {
       p = aaBuf->getDataPtr() + yy * aaBuf->getRowSize() + (xx >> 3);
@@ -420,7 +421,7 @@ void SplashXPathScanner::clipAALine(SplashBitmap *aaBuf,
       for (; xx + 7 <= xx0; xx += 8) {
 	*p++ = 0x00;
       }
-      if (xx <= xx0) {
+      if (xx < xx0) {
 	*p &= 0xff >> (xx0 & 7);
       }
     }


More information about the poppler mailing list