[poppler] qt5/src

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 28 00:00:01 UTC 2020


 qt5/src/poppler-annotation.cc |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit c48f469cd6755fb9fea7870d6b64aaf891cb2012
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Nov 28 00:55:49 2020 +0100

    qt5: Fix division by 0 in broken files
    
    oss-fuzz/27983

diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc
index f30e4d55..43ded2b8 100644
--- a/qt5/src/poppler-annotation.cc
+++ b/qt5/src/poppler-annotation.cc
@@ -298,6 +298,14 @@ PDFRectangle AnnotationPrivate::boundaryToPdfRectangle(const QRectF &r, int rFla
 {
     Q_ASSERT(pdfPage);
 
+    const double w = pdfPage->getCropWidth();
+    const double h = pdfPage->getCropHeight();
+
+    if (w == 0 || h == 0) {
+        // page is broken, there's nothing to transform
+        return {};
+    }
+
     const int pageRotate = pdfPage->getRotate();
 
     double MTX[6];


More information about the poppler mailing list