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