increase robustness of <img> tag in Text component
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 18 Jun 2026 11:20:38 +0000 (14:20 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 18 Jun 2026 11:20:38 +0000 (14:20 +0300)
commiteea6b11fb2ac1507e898ab3b94a81aba019828a6
treea3144a71980050cee4000652506dc62ee0af640d
parent8a34854c70218c6b522cba91ffb5acf21439891c
increase robustness of <img> tag in Text component

Origin: upstream, https://code.qt.io/cgit/qt/qtdeclarative.git/commit/?id=4aaf9bf21f7cc69d
Last-Update: 2025-12-09

For Text.StyledText, there was no protection against <img> tags
with very large widths or heights. This could cause an application
to spend a very long time processing a layout and sometimes crash
if the size was too large.

We reuse the internal coord limit in QPainter as our maximum size
here, similar to what we do in Qt Svg for instance.

For Text.RichText, there were no issues in release builds, but in
debug builds, you could trigger an overflow assert when rounding
the number if it exceeded INT_MAX. For this, we simply cap the
width and height at INT_MAX.

Gbp-Pq: Name CVE-2025-12385.patch
src/quick/items/qquicktextdocument.cpp
src/quick/util/qquickstyledtext.cpp