poppler/Gfx.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)
New commits: commit a01e2d41fcb638fe340bd3d4d22bd13db245e0fd Author: Thomas Freitag <[email protected]> Date: Wed Mar 20 22:35:08 2013 +0100 check order bounding box values in tiling pattern Bug #62369 diff --git a/poppler/Gfx.cc b/poppler/Gfx.cc index 5c9ed35..7047482 100644 --- a/poppler/Gfx.cc +++ b/poppler/Gfx.cc @@ -28,7 +28,7 @@ // Copyright (C) 2008 Michael Vrable <[email protected]> // Copyright (C) 2008 Hib Eris <[email protected]> // Copyright (C) 2009 M Joonas Pihlaja <[email protected]> -// Copyright (C) 2009-2012 Thomas Freitag <[email protected]> +// Copyright (C) 2009-2013 Thomas Freitag <[email protected]> // Copyright (C) 2009 William Bader <[email protected]> // Copyright (C) 2009, 2010 David Benjamin <[email protected]> // Copyright (C) 2010 Nils Höglund <[email protected]> @@ -2205,10 +2205,20 @@ void Gfx::doTilingPatternFill(GfxTilingPattern *tPat, //~ edge instead of left/bottom (?) xstep = fabs(tPat->getXStep()); ystep = fabs(tPat->getYStep()); - xi0 = (int)ceil((xMin - tPat->getBBox()[2]) / xstep); - xi1 = (int)floor((xMax - tPat->getBBox()[0]) / xstep) + 1; - yi0 = (int)ceil((yMin - tPat->getBBox()[3]) / ystep); - yi1 = (int)floor((yMax - tPat->getBBox()[1]) / ystep) + 1; + if (tPat->getBBox()[0] < tPat->getBBox()[2]) { + xi0 = (int)ceil((xMin - tPat->getBBox()[2]) / xstep); + xi1 = (int)floor((xMax - tPat->getBBox()[0]) / xstep) + 1; + } else { + xi0 = (int)ceil((xMin - tPat->getBBox()[0]) / xstep); + xi1 = (int)floor((xMax - tPat->getBBox()[2]) / xstep) + 1; + } + if (tPat->getBBox()[1] < tPat->getBBox()[3]) { + yi0 = (int)ceil((yMin - tPat->getBBox()[3]) / ystep); + yi1 = (int)floor((yMax - tPat->getBBox()[1]) / ystep) + 1; + } else { + yi0 = (int)ceil((yMin - tPat->getBBox()[1]) / ystep); + yi1 = (int)floor((yMax - tPat->getBBox()[3]) / ystep) + 1; + } for (i = 0; i < 4; ++i) { m1[i] = m[i]; }
_______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
