[graphics/kdegraphics-mobipocket] 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 c426eb3202c696518496b6a558a62e4a0c4fa75b by Albert Astals Cid.
Committed on 31/07/2026 at 12:09.
Pushed by aacid into branch 'master'.

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

M  +1    -1    lib/mobipocket.cpp

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

diff --git a/lib/mobipocket.cpp b/lib/mobipocket.cpp
index b5405e3..cc790ac 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.