76f8c5
From d716e636231c8d636bf2139896d817b66fe6d510 Mon Sep 17 00:00:00 2001
76f8c5
From: Marek Kasik <mkasik@redhat.com>
76f8c5
Date: Thu, 21 Mar 2019 13:15:37 +0100
76f8c5
Subject: [PATCH 1/2] cairo: Compute correct coverage values for box filter
76f8c5
76f8c5
Use double precision for computation of coverage
76f8c5
of the left most pixel in the box filter.
76f8c5
76f8c5
Issue #736
76f8c5
---
76f8c5
 poppler/CairoRescaleBox.cc | 9 +++++----
76f8c5
 1 file changed, 5 insertions(+), 4 deletions(-)
76f8c5
76f8c5
diff --git a/poppler/CairoRescaleBox.cc b/poppler/CairoRescaleBox.cc
76f8c5
index b8371a5b..d7615010 100644
76f8c5
--- a/poppler/CairoRescaleBox.cc
76f8c5
+++ b/poppler/CairoRescaleBox.cc
76f8c5
@@ -226,10 +227,10 @@ static int compute_coverage (int coverage[], int src_length, int dest_length)
76f8c5
     /* I have a proof of this, which this margin is too narrow to contain */
76f8c5
     for (i=0; i
76f8c5
     {
76f8c5
-        float left_side = i*scale;
76f8c5
-        float right_side = (i+1)*scale;
76f8c5
-        float right_fract = right_side - floor (right_side);
76f8c5
-        float left_fract = ceil (left_side) - left_side;
76f8c5
+        double left_side = i*scale;
76f8c5
+        double right_side = (i+1)*scale;
76f8c5
+        double right_fract = right_side - floor (right_side);
76f8c5
+        double left_fract = ceil (left_side) - left_side;
76f8c5
         int overage;
76f8c5
         /* find out how many source pixels will be used to fill the box */
76f8c5
         int count = floor (right_side) - ceil (left_side);
76f8c5
-- 
76f8c5
2.20.1
76f8c5