aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickshadereffect.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-13 17:48:42 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-15 20:12:26 +0000
commit9b36512b9453f429644b0c388d381f7a2fc0f825 (patch)
treee573f34053e3c15f9900bbe5c4a92695a2576896 /src/quick/items/qquickshadereffect.cpp
parent733adcf32c1cce288435940c66846a51ad29a464 (diff)
Avoid illegal downcasts in texture and shader handling
Fixes bad type-cast during destruction when objects no longer has the full type they used to. Detected by UBSAN. Change-Id: I4867091901d70d5a882656834eb97a704def1751 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/quick/items/qquickshadereffect.cpp')
-rw-r--r--src/quick/items/qquickshadereffect.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index ab79b69c8c..05d9e5e36d 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -795,7 +795,8 @@ bool QQuickShaderEffect::event(QEvent *e)
return QQuickItem::event(e);
}
#endif
- m_impl->handleEvent(e);
+ if (m_impl)
+ m_impl->handleEvent(e);
return QQuickItem::event(e);
}