<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Avoid round-off errors when determining raster dimensions."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=78809">78809</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Avoid round-off errors when determining raster dimensions.
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>cloos@jhcloos.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>utils
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=99199" name="attach_99199" title="Avoid round-off errors when determining raster dimensions.">attachment 99199</a> <a href="attachment.cgi?id=99199&action=edit" title="Avoid round-off errors when determining raster dimensions.">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>