[poppler] splash/Splash.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Jun 15 14:57:18 PDT 2010


 splash/Splash.cc |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9838edf8c7497858e3bac2743784a3259f61cfdd
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Jun 15 22:54:34 2010 +0100

    Protect us against negative y coordinates
    
    Happens very rarely, like in bug 28480

diff --git a/splash/Splash.cc b/splash/Splash.cc
index 8b11583..bea4706 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -42,6 +42,9 @@
 #include "SplashGlyphBitmap.h"
 #include "Splash.h"
 
+// to get the unlikely definition
+#include "Object.h"
+
 //------------------------------------------------------------------------
 
 // distance of Bezier control point from center for circle approximation
@@ -646,6 +649,9 @@ inline void Splash::pipeIncX(SplashPipe *pipe) {
 }
 
 inline void Splash::drawPixel(SplashPipe *pipe, int x, int y, GBool noClip) {
+  if (unlikely(y < 0))
+    return;
+
   if (noClip || state->clip->test(x, y)) {
     pipeSetXY(pipe, x, y);
     pipeRun(pipe);


More information about the poppler mailing list