[Poppler-bugs] [Bug 78809] New: Avoid round-off errors when determining raster dimensions.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri May 16 21:43:36 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=78809

          Priority: medium
            Bug ID: 78809
          Assignee: poppler-bugs at lists.freedesktop.org
           Summary: Avoid round-off errors when determining raster
                    dimensions.
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: cloos at jhcloos.com
          Hardware: All
            Status: NEW
           Version: unspecified
         Component: utils
           Product: poppler

Created attachment 99199
  --> https://bugs.freedesktop.org/attachment.cgi?id=99199&action=edit
Avoid round-off errors when determining raster dimensions.

The code in pdftoppm.cc and pdftocairo.cc carefully avoided overflow
when converting page sizes from points to pixels.

This worked well when the math was performed at extended precision,
as is done when using x387 opcodes, but could lead to results too
large by a ulp when computed without extra precision.

The code then needs to call ceil(3) to round fractional results up
to the next larger integer, resulting in an off-by-one error if the
computed size is even one ulp more than an integer.

The initial size is already a multiple of 72, so rearranging the math
to multiply before dividing by 72 avoids that imprecision.

Please consider pulling the signed tag at:

  git://people.freedesktop.org/~cloos/poppler.git refs/tags/roundoff

  utils/pdftocairo.cc | 4 ++--
  utils/pdftoppm.cc   | 4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

I’ve also attached the formatted patch for review.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20140517/5be3ee80/attachment.html>


More information about the Poppler-bugs mailing list