summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2020-04-09 13:06:01 +0200
committerKirill Burtsev <kirill.burtsev@qt.io>2020-04-09 21:02:20 +0200
commitb0234f390c170fd6604be6ca50a13a5597900662 (patch)
tree2fad9aac48e3ad63aaa5e93be805366c3ec1cdf2
parentf24d51057d77978af9a3747e7ebfd8cddc9df3ad (diff)
Fix crash on fence create after failure to make context current
GLFence::Create requires valid current gl context, which is not the case if InProcCommandBuffer::MakeCurrent fails: driver and api structures will be null after context loss (for examples on os resume with desktop gl), that triggers access violation. Fixes: QTBUG-82656 Change-Id: If46a252147d1d3a0be7d2b19f7bbc36ac1dd338a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
-rw-r--r--src/core/compositor/display_overrides.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/compositor/display_overrides.cpp b/src/core/compositor/display_overrides.cpp
index 494c7b4d4..89bf8ad2f 100644
--- a/src/core/compositor/display_overrides.cpp
+++ b/src/core/compositor/display_overrides.cpp
@@ -76,7 +76,10 @@ void gpu::InProcessCommandBuffer::GetTextureQt(
void gpu::InProcessCommandBuffer::GetTextureQtOnGpuThread(
unsigned int client_id, GetTextureCallback callback)
{
- MakeCurrent();
+ if (!MakeCurrent()) {
+ LOG(ERROR) << "MakeCurrent failed for GetTextureQt";
+ return;
+ }
gpu::TextureBase *texture = decoder_->GetTextureBase(client_id);
std::move(callback).Run(texture ? texture->service_id() : 0, gl::GLFence::Create());
}