[poppler] poppler/PSOutputDev.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 16 20:45:24 UTC 2021


 poppler/PSOutputDev.cc |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 77eb02c23be27ce66b7f99bcd136356e20a0a12d
Author: Philipp Knechtges <philipp-dev at knechtges.com>
Date:   Sat Jun 12 22:16:43 2021 +0200

    PSOutputDev: fix off-by-one error for image masking in L1/L2 output
    
    Fixes issue #1088

diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 3fb0c703..aeba5fce 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -5620,8 +5620,8 @@ void PSOutputDev::maskToClippingPath(Stream *maskStr, int maskWidth, int maskHei
                 }
                 rectsOut[rectsOutLen].x0 = rects0[i].x0;
                 rectsOut[rectsOutLen].x1 = rects0[i].x1;
-                rectsOut[rectsOutLen].y0 = maskHeight - y - 1;
-                rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1;
+                rectsOut[rectsOutLen].y0 = maskHeight - y;
+                rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0;
                 ++rectsOutLen;
                 ++i;
             }
@@ -5661,8 +5661,8 @@ void PSOutputDev::maskToClippingPath(Stream *maskStr, int maskWidth, int maskHei
         }
         rectsOut[rectsOutLen].x0 = rects0[i].x0;
         rectsOut[rectsOutLen].x1 = rects0[i].x1;
-        rectsOut[rectsOutLen].y0 = maskHeight - y - 1;
-        rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0 - 1;
+        rectsOut[rectsOutLen].y0 = maskHeight - y;
+        rectsOut[rectsOutLen].y1 = maskHeight - rects0[i].y0;
         ++rectsOutLen;
     }
     if (rectsOutLen < 65536 / 4) {
@@ -5769,8 +5769,8 @@ void PSOutputDev::doImageL2(GfxState *state, Object *ref, GfxImageColorMap *colo
                     }
                     rectsOut[rectsOutLen].x0 = rects0[i].x0;
                     rectsOut[rectsOutLen].x1 = rects0[i].x1;
-                    rectsOut[rectsOutLen].y0 = height - y - 1;
-                    rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1;
+                    rectsOut[rectsOutLen].y0 = height - y;
+                    rectsOut[rectsOutLen].y1 = height - rects0[i].y0;
                     ++rectsOutLen;
                     ++i;
                 }
@@ -5826,8 +5826,8 @@ void PSOutputDev::doImageL2(GfxState *state, Object *ref, GfxImageColorMap *colo
             }
             rectsOut[rectsOutLen].x0 = rects0[i].x0;
             rectsOut[rectsOutLen].x1 = rects0[i].x1;
-            rectsOut[rectsOutLen].y0 = height - y - 1;
-            rectsOut[rectsOutLen].y1 = height - rects0[i].y0 - 1;
+            rectsOut[rectsOutLen].y0 = height - y;
+            rectsOut[rectsOutLen].y1 = height - rects0[i].y0;
             ++rectsOutLen;
         }
         if (rectsOutLen < 65536 / 4) {


More information about the poppler mailing list