Bug 637424

Summary: Error: invalidaccess; OffendingCommand: put
Product: Ghostscript Reporter: Jack Moffitt <jack>
Component: PS InterpreterAssignee: Ray Johnston <ray.johnston>
Status: NOTIFIED FIXED    
Severity: normal    
Priority: P4    
Version: master   
Hardware: All   
OS: All   
Customer: Word Size: ---

Description Jack Moffitt 2002-11-12 14:22:26 UTC
Originally reported by: jackiem@users.sourceforge.net
Customer #?

Files Flower.ai.ps and Illustrator10.ai.ps both fail with:

%%[ Error: invalidaccess; OffendingCommand: put ]%%

Test files available on casper.
Comment 1 Alex Cherepanov 2002-11-17 10:16:57 UTC
Comment originally by alexcher@users.sourceforge.net
Logged In: YES 
user_id=65750

The problem is caused by FontDirectory pointing to a global
directory in local mode. The mismatch between currentglobal
and FontDirectory state seems to happen after unsuccessful
attemt to find an Asian font.

/definefont
 { 
   % .....
   dup .FontDirectory 4 -2 roll .growput  % <- it fails in
growput
   % .....
 } odef
Comment 2 Alex Cherepanov 2002-11-17 23:11:40 UTC
Comment originally by alexcher@users.sourceforge.net
Logged In: YES 
user_id=65750

The bug is caused by non-standard /SubstituteFont procedure.
The standard procedure takes a name and returns another
name. GS takes many arguments and returns a font. This fix
brings GS up to the standard while retaining some backward
compatibility.

The sample file replaces SubstituteFont with {pop /Courier} .
This caused stack mix-up, triggered error recovery and
caused other problems later on.
Comment 3 Alex Cherepanov 2002-11-20 20:50:14 UTC
Comment originally by alexcher@users.sourceforge.net
Logged In: YES 
user_id=65750

The patch is committed to the HEAD branch.
Customer # 71