summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2017-05-29 16:59:55 +0100
committerKen Sharp <ken.sharp@artifex.com>2017-05-29 16:59:55 +0100
commit53833cfb21e0f64cdb28d3e4fc320d70447b7760 (patch)
tree8d2918a0c7bb87f5ba7291fd2d4a30f61830bdf3
parentd7e3d98029ba4c06d372c02afa79afe5ddb92ddf (diff)
downloadghostpdl-PDF_gstate.tar.gz
Another case where we expect the 'current dictionary' to be writeablePDF_gstate
after a gsave (q) operation. If we don't do a 'gput' in order to make a writeable copy of nodict and make it current then we get an invalidaccess error. Ideally we would like to get rid of nodict, but we still use it for a lot of PDF interpreter non-gstate related stuff, and we probably always will, so just do a dummy gput for now.
-rw-r--r--Resource/Init/pdf_font.ps10
1 files changed, 9 insertions, 1 deletions
diff --git a/Resource/Init/pdf_font.ps b/Resource/Init/pdf_font.ps
index 0eacba40f..6ed0af3da 100644
--- a/Resource/Init/pdf_font.ps
+++ b/Resource/Init/pdf_font.ps
@@ -1206,7 +1206,15 @@ currentdict /eexec_pdf_param_dict .undef
% Stack: filepos stream
% Don't let setgcolor set the color inside the BuildGlyph
% procedure, because this causes an /undefined error.
- q Font /Resources get exch pdfopdict
+ q
+ %% This is (currently) needed to make sure that the current dictionary, which is
+ %% 'nodict' because we did a gsave, is writeable. If we don't execute gput
+ %% to make a writeable copy then it is a no access dicitonary and the 'def'
+ %% below will fail. It would be nice to fix the cases of this someday, but
+ %% we use 'nodict'[ to store other PDF state stuff that isn't gstate, and we
+ %% probably always will, so it may well be more trouble than its worth.
+ /Dummy false gput
+ Font /Resources get exch pdfopdict
/BuildCharDictDepth countdictstack def
.pdfruncontext
countdictstack BuildCharDictDepth sub