Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.5, 6.2.0 Beta1
-
ee5077daf59f24ca535302799ad718935e6bc4b8 (qt/qtbase/dev) 6d5c61bd7c15f81c81c08e84e09b25180782d98f (qt/qtbase/6.2)
Description
Issue
See https://code.qt.io/cgit/qt/qtbase.git/tree/src/gui/image/qpixmap.cpp#n78
qt_pixmap_thread_test() only checks for the presence of QCoreApplication, not QGuiApplication. As a result, it is possible for the function to dereference the nullptr returned by QGuiApplicationPrivate::platformIntegration() if the function is triggered without a QGuiApplication present.
Suggestion
Check for a QGuiApplication instead of just a QCoreApplication.
This way, even if a user (illegally) creates a QPixmap without a QGuiApplication, they will get a qFatal() assertion with a proper explanation, instead of a segfault without explanation.