diff options
author | Robert Loehning <robert.loehning@qt.io> | 2020-08-27 16:18:58 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2020-08-28 13:19:56 +0000 |
commit | 0bd770fb875d5391dd78df95542c25bd15051938 (patch) | |
tree | 5f7739a05dc09caf511648c900e025150520326f /src/gui/text | |
parent | 8dc38d35258feb9e9f4277127e6148838966ef88 (diff) |
QTextHtmlParserNode: Avoid extreme values for font's pixelsize
They currently cause an integer-overflow in variantHash().
Fixes: oss-fuzz-24702
Pick-to: 5.12 5.15
Change-Id: Ibee4413ca766c8ade9aeff2f2052b82cb9f7d213
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 3eb131b5c0..c2a0fcbec9 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1381,6 +1381,7 @@ void QTextHtmlParserNode::applyCssDeclarations(const QList<QCss::Declaration> &d QFont f; int adjustment = -255; extractor.extractFont(&f, &adjustment); + f.setPixelSize(qMin(f.pixelSize(), INT32_MAX / 2)); // avoid even more extreme values charFormat.setFont(f, QTextCharFormat::FontPropertiesSpecifiedOnly); if (adjustment >= -1) |