pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1765674 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java
Date Wed, 19 Oct 2016 16:27:43 GMT
Author: tilman
Date: Wed Oct 19 16:27:43 2016
New Revision: 1765674

URL: http://svn.apache.org/viewvc?rev=1765674&view=rev
Log:
PDFBOX-3000: avoid ClassCastException if transparency group in softmask isn't one (ghostscript
bug 691854), remove super(), improve javadoc

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java?rev=1765674&r1=1765673&r2=1765674&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/state/PDSoftMask.java
Wed Oct 19 16:27:43 2016
@@ -76,10 +76,11 @@ public final class PDSoftMask implements
 
     /**
      * Creates a new soft mask.
+     *
+     * @param dictionary The soft mask dictionary.
      */
     public PDSoftMask(COSDictionary dictionary)
     {
-        super();
         this.dictionary = dictionary;
     }
 
@@ -114,7 +115,11 @@ public final class PDSoftMask implements
             COSBase cosGroup = getCOSObject().getDictionaryObject(COSName.G);
             if (cosGroup != null)
             {
-                group = (PDTransparencyGroup) PDXObject.createXObject(cosGroup, null);
+                PDXObject x = PDXObject.createXObject(cosGroup, null);
+                if (x instanceof PDTransparencyGroup)
+                {
+                    group = (PDTransparencyGroup) x;
+                }
             }
         }
         return group;



Mime
View raw message