In Artifex Ghostscript through 9.25, the setpattern operator did not properly validate certain types. A specially crafted PostScript document could exploit this to crash Ghostscript or, possibly, execute arbitrary code in the context of the Ghostscript process. This is a type confusion issue because of failure to check whether the Implementation of a pattern dictionary was a structure type.
https://www.ghostscript.com/doc/9.26/News.htm
https://semmle.com/news/semmle-discovers-severe-vulnerability-ghostscript-postscript-pdf
https://lists.debian.org/debian-lts-announce/2018/12/msg00019.html
https://bugs.ghostscript.com/show_bug.cgi?id=700141
https://access.redhat.com/errata/RHSA-2018:3834