pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1645113 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java
Date Sat, 13 Dec 2014 05:01:45 GMT
Author: jahewson
Date: Sat Dec 13 05:01:44 2014
New Revision: 1645113

URL: http://svn.apache.org/r1645113
Log:
PDFBOX-2524: Fix EmptyStackException in PDPageContentStream

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java?rev=1645113&r1=1645112&r2=1645113&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/edit/PDPageContentStream.java
Sat Dec 13 05:01:44 2014
@@ -1512,7 +1512,10 @@ public class PDPageContentStream impleme
      */
     public void saveGraphicsState() throws IOException
     {
-        fontStack.push(fontStack.peek());
+        if (!fontStack.isEmpty())
+        {
+            fontStack.push(fontStack.peek());
+        }
         appendRawCommands(SAVE_GRAPHICS_STATE);
     }
 
@@ -1522,7 +1525,10 @@ public class PDPageContentStream impleme
      */
     public void restoreGraphicsState() throws IOException
     {
-        fontStack.pop();
+        if (!fontStack.isEmpty())
+        {
+            fontStack.pop();
+        }
         appendRawCommands(RESTORE_GRAPHICS_STATE);
     }
 



Mime
View raw message