summaryrefslogtreecommitdiff
path: root/base/gdevepo.c
diff options
context:
space:
mode:
authorKen Sharp <ken.sharp@artifex.com>2018-08-27 11:15:16 +0100
committerKen Sharp <ken.sharp@artifex.com>2018-08-27 11:24:10 +0100
commitea735ba37dc0fd5f5622d031830b9a559dec1cc9 (patch)
tree093a32332728ba1b015073b18b82deb43c29c6c1 /base/gdevepo.c
parent79cccf641486a6595c43f1de1cd7ade696020a31 (diff)
downloadghostpdl-ea735ba37dc0fd5f5622d031830b9a559dec1cc9.tar.gz
Fix error condition for SC and CS
The SC and CS PDF operators correctly checked the return code from the underlying setcolor and setcolorspace code, but we had already set up the exec stack for handling a non-error return. We have to do this before calling the underlying code, as that also uses a state machine, and alters the exec stack. We must push our own execution context first. Ordinarily this isn't a problem, but if we have a custom error handler which doesn't stop the interpreter, then we would continue on to try and use what we'd pushed onto the exec stack, with predictably dire results. Here we avoid this by saving the exec stack pointer on entry, and if an error occurs, restoring back to that point before returning control to the PostScript interpreter. A minor point, but we now also reset the space/color on an error as well, previously it would have been left with the wrong space set.
Diffstat (limited to 'base/gdevepo.c')
0 files changed, 0 insertions, 0 deletions