Bug 687862 - /undefinedresult in --div--
Summary: /undefinedresult in --div--
Status: NOTIFIED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.50
Hardware: All All
: P2 normal
Assignee: Ray Johnston
URL:
Keywords:
: 687738 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-17 09:32 UTC by Jack Moffitt
Modified: 2008-12-19 08:31 UTC (History)
0 users

See Also:
Customer: 770
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jack Moffitt 2004-12-17 09:32:10 UTC
The following customer file fails during processing (tested with display device)
with Error: /undefinedresult in --div--.  It displays fine with xpdf.
Comment 1 Jack Moffitt 2004-12-17 09:32:58 UTC
Created attachment 1110 [details]
36592524V000.pdf
Comment 2 Ray Johnston 2004-12-17 12:57:20 UTC
This one is particularly easy to fix -- a BBox of [0 0 0 0] was
given for a Form XObject.

We simply revert to unity scaling and issue an error message since
the PDF specification states:

BBox (Required) An array of four numbers in the form coordinate system
     (see above), giving the coordinates of the left, bottom, right, and
     top edges, respectively, of the form XObject’s bounding box. These
     boundaries are used to clip the form XObject and to determine its
     size for caching.

Incidentally, this bad PDF was produced by: >>>> Elcad/Aucoplan 7.0.0 <<<<

The patch is:

diff -c -r1.88 pdf_draw.ps
*** lib/pdf_draw.ps     18 Nov 2004 17:09:16 -0000      1.88
--- lib/pdf_draw.ps     17 Dec 2004 20:54:53 -0000
***************
*** 1262,1267 ****
--- 1262,1272 ----
        /BBox knownoget {
          exch pop      % discard y height
          aload pop pop exch pop sub    % BBox width
+         dup 0 eq {
+             (   **** Warning: /BBox has zero width which is not allowed.\n)
+             pdfformaterror
+             pop pop 1 1               % 0 width -- revert to unity scaling
+           } if
          div           % scale x widths
          dup 0 lt { neg } if           % get magnitude
        } {
Comment 3 Ray Johnston 2005-03-10 10:57:26 UTC
*** Bug 687738 has been marked as a duplicate of this bug. ***