qt5/src/poppler-annotation-helper.h | 9 +++++++-- qt6/src/poppler-annotation-helper.h | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-)
New commits: commit 4ef3535bffedd217707ea16f2ba415dbcdc1ed41 Author: Albert Astals Cid <[email protected]> Date: Sat May 8 01:11:57 2021 +0200 qt: Don't assert when trying to invert singular matrices oss-fuzz/33611 diff --git a/qt5/src/poppler-annotation-helper.h b/qt5/src/poppler-annotation-helper.h index c96b7dfc..b294a084 100644 --- a/qt5/src/poppler-annotation-helper.h +++ b/qt5/src/poppler-annotation-helper.h @@ -1,5 +1,5 @@ /* poppler-annotation-helper.h: qt interface to poppler - * Copyright (C) 2006, 2008, 2017-2019, Albert Astals Cid <[email protected]> + * Copyright (C) 2006, 2008, 2017-2019, 2021, Albert Astals Cid <[email protected]> * Copyright (C) 2008, Pino Toscano <[email protected]> * Copyright (C) 2012, Fabio D'Urso <[email protected]> * Copyright (C) 2018, Dileep Sankhla <[email protected]> @@ -55,7 +55,12 @@ void XPDFReader::transform(double *M, double x, double y, QPointF &res) void XPDFReader::invTransform(const double *M, const QPointF p, double &x, double &y) { const double det = M[0] * M[3] - M[1] * M[2]; - Q_ASSERT(det != 0); + if (det == 0) { + qWarning("Tried to invert singular matrix, something won't work"); + x = 0; + y = 0; + return; + } const double invM[4] = { M[3] / det, -M[1] / det, -M[2] / det, M[0] / det }; const double xt = p.x() - M[4]; diff --git a/qt6/src/poppler-annotation-helper.h b/qt6/src/poppler-annotation-helper.h index c96b7dfc..b294a084 100644 --- a/qt6/src/poppler-annotation-helper.h +++ b/qt6/src/poppler-annotation-helper.h @@ -1,5 +1,5 @@ /* poppler-annotation-helper.h: qt interface to poppler - * Copyright (C) 2006, 2008, 2017-2019, Albert Astals Cid <[email protected]> + * Copyright (C) 2006, 2008, 2017-2019, 2021, Albert Astals Cid <[email protected]> * Copyright (C) 2008, Pino Toscano <[email protected]> * Copyright (C) 2012, Fabio D'Urso <[email protected]> * Copyright (C) 2018, Dileep Sankhla <[email protected]> @@ -55,7 +55,12 @@ void XPDFReader::transform(double *M, double x, double y, QPointF &res) void XPDFReader::invTransform(const double *M, const QPointF p, double &x, double &y) { const double det = M[0] * M[3] - M[1] * M[2]; - Q_ASSERT(det != 0); + if (det == 0) { + qWarning("Tried to invert singular matrix, something won't work"); + x = 0; + y = 0; + return; + } const double invM[4] = { M[3] / det, -M[1] / det, -M[2] / det, M[0] / det }; const double xt = p.x() - M[4]; _______________________________________________ poppler mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/poppler
