pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1764154 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
Date Mon, 10 Oct 2016 17:12:18 GMT
Author: tilman
Date: Mon Oct 10 17:12:17 2016
New Revision: 1764154

URL: http://svn.apache.org/viewvc?rev=1764154&view=rev
Log:
PDFBOX-3000: avoid NPE if softmask /G entry missing

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java?rev=1764154&r1=1764153&r2=1764154&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/rendering/PageDrawer.java Mon
Oct 10 17:12:17 2016
@@ -499,20 +499,17 @@ public class PageDrawer extends PDFGraph
 
     private Paint applySoftMaskToPaint(Paint parentPaint, PDSoftMask softMask) throws IOException
     {
-        if (softMask != null) 
+        if (softMask == null || softMask.getGroup() == null)
         {
-            //TODO PDFBOX-2934
-            if (COSName.ALPHA.equals(softMask.getSubType()))
-            {
-                LOG.info("alpha smask not implemented yet, is ignored");
-                return parentPaint;
-            }
-            return new SoftMaskPaint(parentPaint, createSoftMaskRaster(softMask));
+            return parentPaint;
         }
-        else 
+        //TODO PDFBOX-2934
+        if (COSName.ALPHA.equals(softMask.getSubType()))
         {
+            LOG.info("alpha smask not implemented yet, is ignored");
             return parentPaint;
         }
+        return new SoftMaskPaint(parentPaint, createSoftMaskRaster(softMask));
     }
 
     // returns the stroking AWT Paint



Mime
View raw message