This is an automated email from the ASF dual-hosted git repository.

centic pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git

commit b401b92aea12fc8a121d3831b92dab39108c8fca
Author: Dominik Stadler <[email protected]>
AuthorDate: Sat Jan 10 17:12:04 2026 +0100

    Avoid NPE when reading a broken pptx file
---
 .../org/apache/poi/xslf/usermodel/XSLFPictureShape.java |   4 ++--
 .../crash-57308ca363f5b71763c489d1b432aff009d4bc4f.pptx | Bin 0 -> 74295 bytes
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFPictureShape.java 
b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFPictureShape.java
index f87beb78e4..80b5d4a6ce 100644
--- 
a/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFPictureShape.java
+++ 
b/poi-ooxml/src/main/java/org/apache/poi/xslf/usermodel/XSLFPictureShape.java
@@ -189,7 +189,7 @@ public class XSLFPictureShape extends XSLFSimpleShape
     }
 
     protected CTBlip getBlip(){
-        return getBlipFill().getBlip();
+        return getBlipFill() == null ? null : getBlipFill().getBlip();
     }
 
     @SuppressWarnings("WeakerAccess")
@@ -216,7 +216,7 @@ public class XSLFPictureShape extends XSLFSimpleShape
 
     @Override
     public Insets getClipping(){
-        CTRelativeRect r = getBlipFill().getSrcRect();
+        CTRelativeRect r = getBlipFill() == null ? null : 
getBlipFill().getSrcRect();
 
         return (r == null) ? null : new Insets(
             POIXMLUnits.parsePercent(r.xgetT()),
diff --git 
a/test-data/slideshow/crash-57308ca363f5b71763c489d1b432aff009d4bc4f.pptx 
b/test-data/slideshow/crash-57308ca363f5b71763c489d1b432aff009d4bc4f.pptx
new file mode 100644
index 0000000000..7c6cd0987c
Binary files /dev/null and 
b/test-data/slideshow/crash-57308ca363f5b71763c489d1b432aff009d4bc4f.pptx differ


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to