Bug 691624 - Error: /rangecheck in --.discardtransparencymask-- converting pdf to png
Summary: Error: /rangecheck in --.discardtransparencymask-- converting pdf to png
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: PDF Interpreter (show other bugs)
Version: 8.71
Hardware: PC Windows XP
: P4 normal
Assignee: Alex Cherepanov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-17 11:54 UTC by Dennis
Modified: 2011-01-03 06:23 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
Simplified sample file. (1.86 KB, application/pdf)
2011-01-03 05:42 UTC, Alex Cherepanov
Details
patch (1.14 KB, patch)
2011-01-03 05:58 UTC, Alex Cherepanov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis 2010-09-17 11:54:21 UTC
>gswin32c.exe -dSAFER -dBATCH -dNOPAUSE -sDEVICE=png16m -r600 -sOutputFile=tiger_600.png 900710501_01.pdf
GPL Ghostscript 8.71 (2010-02-10)
Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Processing pages 1 through 1.
Page 1
Error: /rangecheck in --.discardtransparencymask--
Operand stack:
   --dict:7/16(L)--   1   11   3   14   Fm3   1.0   --nostringval--   true   4244961   0   0   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_pus
h   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3
 %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   --nostringval--   --nost
ringval--   2   1   1   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--
  false   1   %stopped_push   --nostringval--   --nostringval--   --nostringval--   %array_continue
  --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--
 83687   --nostringval--   1826   4   12   %oparray_pop   --nostringval--   false   1   %stopped_pus
h   1825   4   12   %oparray_pop   --nostringval--   (gstatetype)   --dict:0/0(L)--   --nostringval-
-   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   83376   --nostr
ingval--   1826   6   15   %oparray_pop   --nostringval--   false   1   %stopped_push   1825   6   1
5   %oparray_pop   --nostringval--   (gstatetype)   --dict:4/4(L)--   --nostringval--   false   1
%stopped_push   --nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval
--
Dictionary stack:
   --dict:1159/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:1
08/127(ro)(G)--   --dict:288/300(ro)(G)--   --dict:22/25(L)--   --dict:6/8(L)--   --dict:24/40(L)--
  --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1(ro)(G)--   --dict:1/1
(ro)(G)--   --dict:1/1(ro)(G)--   --dict:9/15(L)--   --dict:1/1(ro)(G)--   --dict:5/5(L)--   --dict:
9/15(L)--
Current allocation mode is local
Last OS error: No such file or directory
GPL Ghostscript 8.71: Unrecoverable error, exit code 1
Comment 1 Ken Sharp 2010-09-17 12:26:32 UTC
Please provide a sample file for us to look at, you may attach it to the bug report by navigating to this page:

http://bugs.ghostscript.com/show_bug.cgi?id=691624

and then following the 'Add an attachment' link.

I suspect the problem is memory exhaustion, caused by transparency present in the PDF file. You could try lowering the resolution to see if that solves the problem.
Comment 2 Ken Sharp 2010-09-20 07:33:14 UTC
The reporter has sent me a file by email. For me this gives an error rangecheck in execform1 which looks like the problem *may* be in the PDF interpreter. Alex,  let me know when you want a copy of the PDF file.
Comment 3 Ken Sharp 2010-09-20 10:46:47 UTC
File is on peeves, in /home/ken. Filename is 9007105010002.pdf
Comment 4 Alex Cherepanov 2011-01-03 05:42:42 UTC
Created attachment 7078 [details]
Simplified sample file.

The sample file has separation color space in SMask stream.
Ghostscript doesn't adjust "pdfcount" variable and cannot process
"scn" correctly.
Comment 5 Alex Cherepanov 2011-01-03 05:58:38 UTC
Created attachment 7079 [details]
patch

Adjust pdfemptycount variable during .execgroup execution to reflect
the actual stack count. Avoid errors in sc1/scn caused by wrong operand
count.
Comment 6 Alex Cherepanov 2011-01-03 06:23:37 UTC
The patch has been committed as a rev. 11987.