diff options
author | Dominik Stadler <centic@apache.org> | 2015-04-20 18:10:43 +0000 |
---|---|---|
committer | Dominik Stadler <centic@apache.org> | 2015-04-20 18:10:43 +0000 |
commit | 1201332d4823845191dff36a170e4c66ee4a4099 (patch) | |
tree | 3a46ba9866c201d49d7877491074d0aae5df2003 | |
parent | 208955bc8cc0b0bba02758d907201d98865d3b25 (diff) | |
download | poi-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.java | 4 | ||||
-rw-r--r-- | test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx | bin | 0 -> 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 Binary files differnew file mode 100644 index 0000000000..057886216f --- /dev/null +++ b/test-data/slideshow/at.ecodesign.www_downloads_Vertiefungsvortrag_elektronik.pptx |