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 692caf0f3673b12126bd100a18496562d55d8375
Author: Dominik Stadler <[email protected]>
AuthorDate: Sat Feb 14 18:40:12 2026 +0100

    Avoid NPE with malformed master-style
---
 .../apache/poi/hslf/usermodel/HSLFSlideMaster.java  |   4 ++++
 .../cf5f6fde99a8b3ea5a4946c258b7abad6f30b0c5.ppt    | Bin 0 -> 9684 bytes
 test-data/spreadsheet/stress.xls                    | Bin 79360 -> 79872 bytes
 3 files changed, 4 insertions(+)

diff --git 
a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java
 
b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java
index 65dcf6dda5..b0929d3bb7 100644
--- 
a/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java
+++ 
b/poi-scratchpad/src/main/java/org/apache/poi/hslf/usermodel/HSLFSlideMaster.java
@@ -112,6 +112,10 @@ public final class HSLFSlideMaster extends HSLFMasterSheet 
{
             return null;
         }
         final TxMasterStyleAtom t = _txmaster[txtype];
+        if (t == null) {
+            throw new IllegalStateException("Cannot get master-style for type 
" + txtype);
+        }
+
         final List<TextPropCollection> styles = isCharacter ? 
t.getCharacterStyles() : t.getParagraphStyles();
         // TODO: what is the reaction for readOnly=false and styles.isEmpty()?
         final int minLevel = Math.min(level, styles.size()-1);
diff --git a/test-data/slideshow/cf5f6fde99a8b3ea5a4946c258b7abad6f30b0c5.ppt 
b/test-data/slideshow/cf5f6fde99a8b3ea5a4946c258b7abad6f30b0c5.ppt
new file mode 100644
index 0000000000..a92aac2d04
Binary files /dev/null and 
b/test-data/slideshow/cf5f6fde99a8b3ea5a4946c258b7abad6f30b0c5.ppt differ
diff --git a/test-data/spreadsheet/stress.xls b/test-data/spreadsheet/stress.xls
index feaeaa201d..099e41e45e 100644
Binary files a/test-data/spreadsheet/stress.xls and 
b/test-data/spreadsheet/stress.xls differ


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

Reply via email to