aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/poi/sl/draw/DrawPaint.java8
-rwxr-xr-xtest-data/slideshow/br.com.tvcamboriu.www_pps_Pensar_5b1_5d.pptbin0 -> 120833 bytes
2 files changed, 7 insertions, 1 deletions
diff --git a/src/java/org/apache/poi/sl/draw/DrawPaint.java b/src/java/org/apache/poi/sl/draw/DrawPaint.java
index 94001fd88c..8d5648f852 100644
--- a/src/java/org/apache/poi/sl/draw/DrawPaint.java
+++ b/src/java/org/apache/poi/sl/draw/DrawPaint.java
@@ -27,6 +27,7 @@ import java.awt.RadialGradientPaint;
import java.awt.geom.AffineTransform;
import java.awt.geom.Point2D;
import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
@@ -145,8 +146,13 @@ public class DrawPaint {
renderer.setAlpha(alpha/100000.f);
}
+ BufferedImage image = renderer.getImage();
+ if(image == null) {
+ LOG.log(POILogger.ERROR, "Can't load image data");
+ return null;
+ }
Rectangle2D textAnchor = shape.getAnchor();
- Paint paint = new java.awt.TexturePaint(renderer.getImage(), textAnchor);
+ Paint paint = new java.awt.TexturePaint(image, textAnchor);
return paint;
}
diff --git a/test-data/slideshow/br.com.tvcamboriu.www_pps_Pensar_5b1_5d.ppt b/test-data/slideshow/br.com.tvcamboriu.www_pps_Pensar_5b1_5d.ppt
new file mode 100755
index 0000000000..b3f01ed281
--- /dev/null
+++ b/test-data/slideshow/br.com.tvcamboriu.www_pps_Pensar_5b1_5d.ppt
Binary files differ