diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java index 935d12331..3431d1c24 100644 --- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java +++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFPictureData.java @@ -163,7 +163,13 @@ public final class XSLFPictureData extends POIXMLDocumentPart implements Picture byte data[] = getData(); checksum = IOUtils.calculateChecksum(data); - switch (getType()) { + PictureType pt = getType(); + if (pt == null) { + origSize = new Dimension(1,1); + return; + } + + switch (pt) { case EMF: origSize = new EMF.NativeHeader(data, 0).getSize(); break;