You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2014/07/21 20:07:57 UTC
svn commit: r1612365 -
/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/util/operator/GRestore.java
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.");
}