Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
libqt5-qtbase.23098
0001-Avoid-crash-in-QScroller.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Avoid-crash-in-QScroller.patch of Package libqt5-qtbase.23098
From 8d8425d7e28ef0b93bf967f9bd6c604ac83c7475 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fabian@ritter-vogt.de> Date: Wed, 25 Nov 2020 20:04:34 +0100 Subject: [PATCH] widgets: Avoid crash in QScroller Quoting c6a32751 in okular[1]: QScrollerPrivate::setDpiFromWidget() before Qt 5.14 crashes when the target widget does not intersect a physical screen, because QDesktopWidget returns screen index `-1` in this case, which leads to an out-of-range read from QApplication::screens(), which leads to a segfault when reading from an invalid QScreen* pointer. [1] https://invent.kde.org/graphics/okular/-/commit/c6a32751 Fixes: QTBUG-88288 Change-Id: Ia572bf0207aa6d8ca2a209d22daa36b962e6de7d --- src/widgets/util/qscroller.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index 1e84237253..8fd3437eaf 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1031,7 +1031,8 @@ void QScrollerPrivate::setDpi(const QPointF &dpi) */ void QScrollerPrivate::setDpiFromWidget(QWidget *widget) { - const QScreen *screen = QGuiApplication::screens().at(QApplication::desktop()->screenNumber(widget)); + const int screenNumber = QApplication::desktop()->screenNumber(widget); + const QScreen *screen = screenNumber < 0 ? QGuiApplication::primaryScreen() : QGuiApplication::screens().at(screenNumber); setDpi(QPointF(screen->physicalDotsPerInchX(), screen->physicalDotsPerInchY())); } -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor