From c320888ff64d81e5e291eb5db683b000b9fe59a8 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Wed, 24 Oct 2018 16:16:06 +0200 Subject: Check the pointer before dereferencing it to avoid crashes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I238698a5f74b426761eb524d88d284176738d5ae Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/webgl/qwebglcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) 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(context->handle()); + if (!handle) + return nullptr; auto integrationPrivate = QWebGLIntegrationPrivate::instance(); const auto clientData = integrationPrivate->findClientData(handle->currentSurface()); if (!clientData || !clientData->socket -- cgit v1.2.3