Blame SOURCES/ghostscript-cve-2019-14817.patch

dbb3ab
diff --git a/Resource/Init/pdf_base.ps b/Resource/Init/pdf_base.ps
6fb37a
index 1a218f4..cffde5c 100644
dbb3ab
--- a/Resource/Init/pdf_base.ps
dbb3ab
+++ b/Resource/Init/pdf_base.ps
6fb37a
@@ -157,7 +157,7 @@ currentdict /num-chars-dict .undef
dbb3ab
     {
dbb3ab
       dup ==only () = flush
dbb3ab
     } ifelse % PDFSTEP
dbb3ab
-  } if % PDFDEBUG
dbb3ab
+  } executeonly if % PDFDEBUG
dbb3ab
   2 copy .knownget {
dbb3ab
     exch pop exch pop exch pop exec
dbb3ab
   } {
dbb3ab
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
6fb37a
index e18a7c2..0a3924c 100644
dbb3ab
--- a/Resource/Init/pdf_draw.ps
dbb3ab
+++ b/Resource/Init/pdf_draw.ps
dbb3ab
@@ -501,8 +501,8 @@ end
dbb3ab
       (        Output may be incorrect.\n) pdfformaterror
dbb3ab
       //pdfdict /.gs_warning_issued //true .forceput
dbb3ab
       PDFSTOPONERROR { /gs /undefined signalerror } if
dbb3ab
-    } if
dbb3ab
-  }
dbb3ab
+    } executeonly if
dbb3ab
+  } executeonly
dbb3ab
   ifelse
dbb3ab
 } bind executeonly def
dbb3ab
 
6fb37a
@@ -1142,7 +1142,7 @@ currentdict end readonly def
dbb3ab
           .setglobal
dbb3ab
           pdfformaterror
dbb3ab
         } executeonly ifelse
dbb3ab
-      }
dbb3ab
+      } executeonly
dbb3ab
       {
dbb3ab
         currentglobal //pdfdict gcheck .setglobal
dbb3ab
         //pdfdict /.Qqwarning_issued //true .forceput
6fb37a
@@ -1150,8 +1150,8 @@ currentdict end readonly def
dbb3ab
         pdfformaterror
dbb3ab
       } executeonly ifelse
dbb3ab
       end
dbb3ab
-    } ifelse
dbb3ab
-  } loop
dbb3ab
+    } executeonly ifelse
dbb3ab
+  } executeonly loop
dbb3ab
   {
dbb3ab
     (\n   **** Error: File has unbalanced q/Q operators \(too many q's\)\n               Output may be incorrect.\n)
dbb3ab
     //pdfdict /.Qqwarning_issued .knownget
6fb37a
@@ -1165,14 +1165,14 @@ currentdict end readonly def
dbb3ab
         .setglobal
dbb3ab
         pdfformaterror
dbb3ab
       } executeonly ifelse
dbb3ab
-    }
dbb3ab
+    } executeonly
dbb3ab
     {
dbb3ab
       currentglobal //pdfdict gcheck .setglobal
dbb3ab
       //pdfdict /.Qqwarning_issued //true .forceput
dbb3ab
       .setglobal
dbb3ab
       pdfformaterror
dbb3ab
     } executeonly ifelse
dbb3ab
-  } if
dbb3ab
+  } executeonly if
dbb3ab
   pop
dbb3ab
 
dbb3ab
   % restore pdfemptycount
dbb3ab
diff --git a/Resource/Init/pdf_font.ps b/Resource/Init/pdf_font.ps
6fb37a
index 9fb85f6..357ba30 100644
dbb3ab
--- a/Resource/Init/pdf_font.ps
dbb3ab
+++ b/Resource/Init/pdf_font.ps
dbb3ab
@@ -677,7 +677,7 @@ currentdict end readonly def
dbb3ab
                 currentglobal 2 index dup gcheck setglobal
dbb3ab
                 /FontInfo 5 dict dup 5 1 roll .forceput
dbb3ab
                 setglobal
dbb3ab
-              } if
dbb3ab
+              } executeonly if
dbb3ab
               dup /GlyphNames2Unicode .knownget not {
dbb3ab
                 //true                        % No existing G2U, make one
dbb3ab
               } {
dbb3ab
@@ -701,9 +701,9 @@ currentdict end readonly def
dbb3ab
         } if
dbb3ab
         PDFDEBUG {
dbb3ab
           (.processToUnicode end) =
dbb3ab
-        } if
dbb3ab
-      } if
dbb3ab
-    } stopped
dbb3ab
+        } executeonly if
dbb3ab
+      } executeonly if
dbb3ab
+    } executeonly stopped
dbb3ab
     {
dbb3ab
       .dstackdepth 1 countdictstack 1 sub
dbb3ab
       {pop end} for
6fb37a
@@ -1233,19 +1233,20 @@ currentdict /eexec_pdf_param_dict .undef
dbb3ab
                 //pdfdict /.Qqwarning_issued //true .forceput
dbb3ab
               } executeonly if
dbb3ab
               Q
dbb3ab
-            } repeat
dbb3ab
+            } executeonly repeat
dbb3ab
             Q
dbb3ab
-          } PDFfile fileposition 2 .execn % Keep pdfcount valid.
dbb3ab
+          } executeonly PDFfile fileposition 2 .execn % Keep pdfcount valid.
dbb3ab
           PDFfile exch setfileposition
dbb3ab
-        } ifelse
dbb3ab
-      } {
dbb3ab
+        } executeonly ifelse
dbb3ab
+      } executeonly
dbb3ab
+      {
dbb3ab
         % PDF Type 3 fonts don't use .notdef
dbb3ab
         % d1 implementation adjusts the width as needed
dbb3ab
         0 0 0 0 0 0
dbb3ab
         pdfopdict /d1 get exec
dbb3ab
       } ifelse
dbb3ab
       end end
dbb3ab
-    } bdef
dbb3ab
+    } executeonly bdef
dbb3ab
     dup currentdict Encoding .processToUnicode
dbb3ab
     currentdict end .completefont exch pop
dbb3ab
 } bind executeonly odef
6fb37a
@@ -2045,9 +2046,9 @@ currentdict /CMap_read_dict undef
dbb3ab
           (Will continue, but content may be missing.) = flush
dbb3ab
         } ifelse
dbb3ab
       } if
dbb3ab
-    } if
dbb3ab
+    } executeonly if
dbb3ab
     /findresource cvx /undefined signalerror
dbb3ab
-  } loop
dbb3ab
+  } executeonly loop
dbb3ab
 } bind executeonly odef
dbb3ab
 
dbb3ab
 /buildCIDType0 {	% <CIDFontType0-font-resource> buildCIDType0 <font>
dbb3ab
diff --git a/Resource/Init/pdf_main.ps b/Resource/Init/pdf_main.ps
6fb37a
index 5305ea6..a59e63c 100644
dbb3ab
--- a/Resource/Init/pdf_main.ps
dbb3ab
+++ b/Resource/Init/pdf_main.ps
6fb37a
@@ -2749,15 +2749,15 @@ currentdict /PDF2PS_matrix_key undef
dbb3ab
           .setglobal
dbb3ab
           pdfformaterror
dbb3ab
         } executeonly ifelse
dbb3ab
-      }
dbb3ab
+      } executeonly
dbb3ab
       {
dbb3ab
         currentglobal //pdfdict gcheck .setglobal
dbb3ab
         //pdfdict /.Qqwarning_issued //true .forceput
dbb3ab
         .setglobal
dbb3ab
         pdfformaterror
dbb3ab
       } executeonly ifelse
dbb3ab
-    } if
dbb3ab
-  } if
dbb3ab
+    } executeonly if
dbb3ab
+  } executeonly if
dbb3ab
   pop
dbb3ab
   count PDFexecstackcount sub { pop } repeat
dbb3ab
   (after exec) VMDEBUG
dbb3ab
diff --git a/Resource/Init/pdf_ops.ps b/Resource/Init/pdf_ops.ps
6fb37a
index 285e582..6c1f100 100644
dbb3ab
--- a/Resource/Init/pdf_ops.ps
dbb3ab
+++ b/Resource/Init/pdf_ops.ps
dbb3ab
@@ -186,14 +186,14 @@ currentdict /gput_always_allow .undef
dbb3ab
         .setglobal
dbb3ab
         pdfformaterror
dbb3ab
       } executeonly ifelse
dbb3ab
-    }
dbb3ab
+    } executeonly
dbb3ab
     {
dbb3ab
       currentglobal //pdfdict gcheck .setglobal
dbb3ab
       //pdfdict /.Qqwarning_issued //true .forceput
dbb3ab
       .setglobal
dbb3ab
       pdfformaterror
dbb3ab
     } executeonly ifelse
dbb3ab
-  } if
dbb3ab
+  } executeonly if
dbb3ab
 } bind executeonly odef
dbb3ab
 
dbb3ab
 % Save PDF gstate
dbb3ab
@@ -440,11 +440,12 @@ currentdict /gput_always_allow .undef
dbb3ab
   dup type /booleantype eq {
dbb3ab
     .currentSMask type /dicttype eq {
dbb3ab
       .currentSMask /Processed 2 index .forceput
dbb3ab
+    } executeonly
dbb3ab
+    {
dbb3ab
+      .setSMask
dbb3ab
+    }ifelse
dbb3ab
   } executeonly
dbb3ab
   {
dbb3ab
-      .setSMask
dbb3ab
-  }ifelse
dbb3ab
-  }{
dbb3ab
   .setSMask
dbb3ab
   }ifelse
dbb3ab