[graphics/kdegraphics-mobipocket/release/26.08] lib: DocumentPrivate::init: return early if dec is not valid

Albert Astals Cid <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit cb788b08a9bdc98c3e9807a14cf647e281c4fb14 by Albert Astals Cid.
Committed on 31/07/2026 at 15:13.
Pushed by aacid into branch 'release/26.08'.

DocumentPrivate::init: return early if dec is not valid

(cherry picked from commit c426eb3202c696518496b6a558a62e4a0c4fa75b)

M  +1    -1    lib/mobipocket.cpp

https://invent.kde.org/graphics/kdegraphics-mobipocket/-/commit/cb788b08a9bdc98c3e9807a14cf647e281c4fb14

diff --git a/lib/mobipocket.cpp b/lib/mobipocket.cpp
index 7901411..0927995 100644
--- a/lib/mobipocket.cpp
+++ b/lib/mobipocket.cpp
@@ -115,7 +115,7 @@ void DocumentPrivate::init()
     dec = Decompressor::create(mhead[1], getHuffRecords(pdb));
     if ((int)mhead[12] != 0 || (int)mhead[13] != 0)
         drm = true;
-    if (!dec)
+    if (!dec || !dec->isValid())
         return;
 
     ntextrecords = qFromBigEndian<quint16>(mhead.constData() + 8);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.