[gs-bugs] [Bug 692805] New: fitz/base_geometry.c Commit "Remove fuzzing from fz_round_rect" results in incorrect pixmap sizes.

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Fri Jan 20 15:01:11 UTC 2012


http://bugs.ghostscript.com/show_bug.cgi?id=692805

           Summary: fitz/base_geometry.c Commit "Remove fuzzing from
                    fz_round_rect" results in incorrect pixmap sizes.
           Product: MuPDF
           Version: unspecified
          Platform: PC
        OS/Version: Windows 7
            Status: NEW
          Severity: normal
          Priority: P4
         Component: fitz
        AssignedTo: tor.andersson at artifex.com
        ReportedBy: danwaleke at quickenloans.com
         QAContact: gs-bugs at ghostscript.com


When scaling PDF pages to custom sizes the resulting pixmaps are not sized
correctly.

Reversing this commit fixes the problem.   I can provide more details if
necessary.


--- a/fitz/base_geometry.c
+++ b/fitz/base_geometry.c
@@ -153,11 +153,10 @@ fz_bbox
 fz_round_rect(fz_rect f)
 {
        fz_bbox i;
-       /* adjust by 0.001 to compensate for precision errors */
-       f.x0 = floorf(f.x0 + 0.001f);
-       f.y0 = floorf(f.y0 + 0.001f);
-       f.x1 = ceilf(f.x1 - 0.001f);
-       f.y1 = ceilf(f.y1 - 0.001f);
+       f.x0 = floorf(f.x0 + FLT_EPSILON);
+       f.y0 = floorf(f.y0 + FLT_EPSILON);
+       f.x1 = ceilf(f.x1 - FLT_EPSILON);
+       f.y1 = ceilf(f.y1 - FLT_EPSILON);
 #define SAFE_INT(f) ((f > INT_MAX) ? INT_MAX : ((f < INT_MIN) ? INT_MIN :
(int)f))
        i.x0 = SAFE_INT(f.x0);
        i.y0 = SAFE_INT(f.y0);


author    Tor Andersson <tor.andersson at artifex.com>
Wed, 11 Jan 2012 14:31:34 +0000 (15:31 +0100)
committer    Tor Andersson <tor.andersson at artifex.com>
Wed, 11 Jan 2012 15:01:29 +0000 (16:01 +0100)
commit    220b6f3565b8ec6da406acc08e8f09128b7c7346
tree    64de28a72978c18d49da2756bb58c73694d7697b    tree | snapshot
parent    02ffa5b15d37cc86964666c78446433f31a15911    commit | diff

-- 
Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gs-bugs mailing list