summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-10-24 16:16:06 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2018-10-24 18:28:40 +0000
commitc320888ff64d81e5e291eb5db683b000b9fe59a8 (patch)
treebe642c5ca12ceb57e6df1d206aa04c988119e96f
parente14f45692d5a0ffc15bfd3b85e4fd31d7e578d31 (diff)
Check the pointer before dereferencing it to avoid crashesv5.12.0-beta4
Change-Id: I238698a5f74b426761eb524d88d284176738d5ae Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
-rw-r--r--src/plugins/platforms/webgl/qwebglcontext.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/webgl/qwebglcontext.cpp b/src/plugins/platforms/webgl/qwebglcontext.cpp
index 9d48d74..07378a2 100644
--- a/src/plugins/platforms/webgl/qwebglcontext.cpp
+++ b/src/plugins/platforms/webgl/qwebglcontext.cpp
@@ -1570,6 +1570,8 @@ QWebGLFunctionCall *QWebGLContext::createEvent(const QString &functionName, bool
auto context = QOpenGLContext::currentContext();
Q_ASSERT(context);
const auto handle = static_cast<QWebGLContext *>(context->handle());
+ if (!handle)
+ return nullptr;
auto integrationPrivate = QWebGLIntegrationPrivate::instance();
const auto clientData = integrationPrivate->findClientData(handle->currentSurface());
if (!clientData || !clientData->socket