pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1612365 - /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
Date Mon, 21 Jul 2014 18:07:57 GMT
Author: tilman
Date: Mon Jul 21 18:07:56 2014
New Revision: 1612365

URL: http://svn.apache.org/r1612365
Log:
PDFBOX-2214: graphics stack must have at least one element because of peek() in PDFStreamEngine

Modified:
    pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java

Modified: pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java?rev=1612365&r1=1612364&r2=1612365&view=diff
==============================================================================
--- pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
(original)
+++ pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
Mon Jul 21 18:07:56 2014
@@ -43,13 +43,13 @@ public class GRestore extends OperatorPr
      */
     public void process(PDFOperator operator, List<COSBase> arguments)
     {
-        if (context.getGraphicsStack().size() > 0)
+        if (context.getGraphicsStack().size() > 1)
         {
             context.setGraphicsState((PDGraphicsState) context.getGraphicsStack().pop());
         }
         else
         {
-    		// this shouldn't happen but it does, see PDFBOX-161
+            // this shouldn't happen but it does, see PDFBOX-161
             // TODO make this self healing mechanism optional for preflight??
             LOG.error("GRestore: no graphics state left to be restored.");
         }



Mime
View raw message