aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2015-04-20 18:10:43 +0000
committerDominik Stadler <centic@apache.org>2015-04-20 18:10:43 +0000
commit1201332d4823845191dff36a170e4c66ee4a4099 (patch)
tree3a46ba9866c201d49d7877491074d0aae5df2003
parent208955bc8cc0b0bba02758d907201d98865d3b25 (diff)
downloadpoi-1201332d4823845191dff36a170e4c66ee4a4099.tar.gz
poi-1201332d4823845191dff36a170e4c66ee4a4099.zip
Avoid NullPointerException if an image cannot be read
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1674952 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFImageRenderer.java4
-rw-r--r--test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptxbin0 -> 1949517 bytes
2 files changed, 4 insertions, 0 deletions
diff --git a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFImageRenderer.java b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFImageRenderer.java
index 6e2633515a..7153bc86a8 100644
--- a/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFImageRenderer.java
+++ b/src/ooxml/java/org/apache/poi/xslf/usermodel/XSLFImageRenderer.java
@@ -99,6 +99,10 @@ public class XSLFImageRenderer {
} catch (Exception e) {
return false;
}
+
+ if(img == null) {
+ return false;
+ }
int iw = img.getWidth();
int ih = img.getHeight();
diff --git a/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx b/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx
new file mode 100644
index 0000000000..057886216f
--- /dev/null
+++ b/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx
Binary files differ