Bug 691502 - Regression: damaged PDF file cannot be read starting with r11392
Summary: Regression: damaged PDF file cannot be read starting with r11392
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: master
Hardware: PC All
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-26 21:15 UTC by Marcos H. Woehrmann
Modified: 2010-08-02 21:33 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
patch (2.04 KB, patch)
2010-08-02 21:32 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos H. Woehrmann 2010-07-26 21:15:11 UTC
Starting with r11392 the attached PDF file cannot be read by Ghostscript.  Earlier versions read the file with this warning:

   **** Warning:  File has an invalid xref entry:  7.  Rebuilding xref table.

Later versions, including head, produce:

GPL Ghostscript SVN PRE-RELEASE 9.00 (2010-07-31)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
   **** Warning:  File has an invalid xref entry:  7.  Rebuilding xref table.
   **** Warning:  There are objects with matching object and generation
   **** numbers.  The accuracy of the resulting image is unknown.
Processing pages 1 through 1.
Page 1
   **** Unrecoverable error in xref!
Error: /rangecheck in resolveR
Operand stack:
   --dict:8/17(L)--   --dict:10/18(L)--   637   --nostringval--   --nostringval--   637   12   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   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   637   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
Dictionary stack:
   --dict:1151/1684(ro)(G)--   --dict:1/20(G)--   --dict:82/200(L)--   --dict:82/200(L)--   --dict:108/127(ro)(G)--   --dict:290/300(ro)(G)--   --dict:24/25(L)--   --dict:6/8(L)--   --dict:22/40(L)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:5/16(L)--
Current allocation mode is local
Last OS error: 2
GPL Ghostscript SVN PRE-RELEASE 9.00: Unrecoverable error, exit code 1
Exit 1



The command line I'm using for testing:

  bin/s -sDEVICE=ppmraw -o test.ppm ./damagedxref.pdf
Comment 2 Alex Cherepanov 2010-08-02 21:32:00 UTC
Created attachment 6595 [details]
patch

Partly revert rev. 11392 that over-simplified the check for a valid obj line
in the PDF file. Use --search-- to reject impossible cases but revert to the
old logic to verify the results.
Comment 3 Alex Cherepanov 2010-08-02 21:33:13 UTC
The patch has been committed as a rev. 11590.