From 07c33ab76f353f6dbb6103d7777cbef242b8f3f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 13 Jan 2020 14:41:28 +0100 Subject: Guard against null-nativeParent in QWidgetBackingStore::markDirtyOnScreen The back port in 1e310b5a4508f removed the check in two of the call sites for this function, that in 5.14 were handled elsewhere, but for 5.12 caused us to not guard against null-nativeParent windows anymore. Change-Id: I698c5a0b6a54bbee37b533fcafa75129768c5db1 Fixes: QTBUG-81315 Reviewed-by: Paul Olav Tvete --- src/widgets/kernel/qwidgetbackingstore.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index b9505a6ed0..38ea5966ae 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -717,7 +717,11 @@ void QWidgetBackingStore::markDirtyOnScreen(const QRegion ®ion, QWidget *widg // Alien widgets. if (!hasPlatformWindow(widget) && !widget->isWindow()) { - QWidget *nativeParent = widget->nativeParentWidget(); // Alien widgets with the top-level as the native parent (common case). + QWidget *nativeParent = widget->nativeParentWidget(); + if (!nativeParent) + return; + + // Alien widgets with the top-level as the native parent (common case). if (nativeParent == tlw) { dirtyOnScreen += region.translated(topLevelOffset); return; -- cgit v1.2.3