Fix possible NullPointerException with invalid/unsupported image types
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1725332 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0173f22787
commit
fe359afec3
@ -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;
|
||||
}
|
||||
|
BIN
test-data/slideshow/br.com.tvcamboriu.www_pps_Pensar_5b1_5d.ppt
Executable file
BIN
test-data/slideshow/br.com.tvcamboriu.www_pps_Pensar_5b1_5d.ppt
Executable file
Binary file not shown.
Loading…
Reference in New Issue
Block a user