poppler/XRef.cc |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit bce14c781b8066ad7e55020e8e2ade5363856854
Author: Albert Astals Cid <aa...@kde.org>
Date:   Sat Nov 28 00:34:52 2020 +0100

    Fix crash in XRef::removeDocInfo() if Info is not a ref
    
    oss-fuzz/27968

diff --git a/poppler/XRef.cc b/poppler/XRef.cc
index 3747c6e7..b92c925b 100644
--- a/poppler/XRef.cc
+++ b/poppler/XRef.cc
@@ -1250,7 +1250,9 @@ void XRef::removeDocInfo()
 
     trailerDict.dictRemove("Info");
 
-    removeIndirectObject(infoObjRef.getRef());
+    if (likely(infoObjRef.isRef())) {
+        removeIndirectObject(infoObjRef.getRef());
+    }
 }
 
 bool XRef::getStreamEnd(Goffset streamStart, Goffset *streamEnd)
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to