Bug 692301 - Unable to open certain PDFs
Summary: Unable to open certain PDFs
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: 9.02
Hardware: PC Linux
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-25 00:03 UTC by derian
Modified: 2011-06-28 00:07 UTC (History)
1 user (show)

See Also:
Customer:
Word Size: ---


Attachments
Problematic PDF File (2.21 MB, application/pdf)
2011-06-25 00:03 UTC, derian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description derian 2011-06-25 00:03:03 UTC
Created attachment 7607 [details]
Problematic PDF File

I'm attempting to set up Ghostscript to allow ImageMagick to convert PDFs into JPGs and have run into an issue with certain PDFs I have (example attached).  I'm running Ghostscript 9.02, compiled today.  I don't encounter this issue with test PDFs I've created, but at the same time I'm able to open the problematic PDFs in a variety of PDF readers.  Here's the command I'm running to test and the error gs is throwing:

[root@274632-web1 gs]# gs  -r20 -q -dNOPAUSE -dBATCH -sDEVICE=jpeg -sOutputFile=PV0000093506.jpg PV0000093506.pdf
Error: /undefined in --run--
Operand stack:
   --dict:7/16(L)--   false   --dict:13/20(L)--   --dict:1/1(L)--   --nostringval--   FlateDecode   --dict:1/1(L)--   0
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   6   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   2318189   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1154/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:108/127(ro)(G)--   --dict:295/300(ro)(G)--   --dict:23/30(L)--   --dict:6/8(L)--   --dict:24/40(L)--   --dict:1/1(ro)(G)--   --dict:8/18(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript 9.02: Unrecoverable error, exit code 1

Let me know if more information is necessary.
Comment 1 Ken Sharp 2011-06-25 08:28:54 UTC
For me current (release) build gets an undefined in --get--, setting -dPDFDEBUG shows object 62 0 (an Image XObject with ImageMask true) as the culprit. If I use a debug build I instead get :

   **** Error reading a content stream. The page may be incomplete.
   **** File did not complete the page properly and may be damaged.

And a partially blank page, missing the large image.

If I decompress the file using MuPDF and render it then it works without problems. I suspect that either there is a problem decompressing the data, or possibly the compressed stream length is incorrect, leading to GS running off the end of the data.

One for Alex.
Comment 2 derian 2011-06-25 09:42:53 UTC
I just verified the error on a completely fresh install of the base OS (RHEL 5.6).  I received the exact same error after compiling the most recent release of GS.
Comment 3 Alex Cherepanov 2011-06-25 12:12:34 UTC
We don't yet handle the case when the image has multiple decoding filters and
one of them is JPXDecode.
Comment 4 Henry Stiles 2011-06-26 17:16:40 UTC
P2 for missing required functionality.
Comment 5 Alex Cherepanov 2011-06-28 00:07:57 UTC
Fix a bug in /JPXDecode filter handler that generated bad
/DecodeParms when /JPXDecode filter was used in a /Filter
array. Remove some obsolete code related to /JPXDecode.

See http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=66700ec35f74a6e049ed6654283418a6d23bfb3e