]> source.dussan.org Git - poi.git/commitdiff
Fix for Softmaker Office files, which set encryption settings invalidly
authorAndreas Beeker <kiwiwings@apache.org>
Wed, 16 Mar 2016 21:05:37 +0000 (21:05 +0000)
committerAndreas Beeker <kiwiwings@apache.org>
Wed, 16 Mar 2016 21:05:37 +0000 (21:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1735298 13f79535-47bb-0310-9956-ffa450edef68

src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFSlideShowEncrypted.java

index 6f0e9e4c494f114aa2571ab65da3c8a33e037b2f..3d77d92d2ada401a9cf07baba443dc59e9b31799 100644 (file)
@@ -85,7 +85,12 @@ public class HSLFSlideShowEncrypted {
         PersistPtrHolder ptr = (PersistPtrHolder)r;
         
         Integer encOffset = ptr.getSlideLocationsLookup().get(userEditAtomWithEncryption.getEncryptSessionPersistIdRef());
-        assert(encOffset != null);
+        if (encOffset == null) {
+            // encryption info doesn't exist anymore
+               // SoftMaker Freeoffice produces such invalid files - check for "SMNativeObjData" ole stream
+            dea = null;
+            return;
+        }
         
         r = recordMap.get(encOffset);
         if (r == null) {