pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1783617 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetRenderingIntent.java
Date Sun, 19 Feb 2017 09:24:43 GMT
Author: tilman
Date: Sun Feb 19 09:24:43 2017
New Revision: 1783617

URL: http://svn.apache.org/viewvc?rev=1783617&view=rev
Log:
PDFBOX-3695: avoid ClassCastException

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetRenderingIntent.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetRenderingIntent.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetRenderingIntent.java?rev=1783617&r1=1783616&r2=1783617&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetRenderingIntent.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/contentstream/operator/state/SetRenderingIntent.java
Sun Feb 19 09:24:43 2017
@@ -40,8 +40,13 @@ public class SetRenderingIntent extends
         {
             throw new MissingOperandException(operator, operands);
         }
-        COSName value = (COSName)operands.get(0);
-        context.getGraphicsState().setRenderingIntent(RenderingIntent.fromString(value.getName()));
+        COSBase base = operands.get(0);
+        if (!(base instanceof COSName))
+        {
+            return;
+        }
+        context.getGraphicsState().setRenderingIntent(
+                RenderingIntent.fromString(((COSName)base).getName()));
     }
 
     @Override



Mime
View raw message