summaryrefslogtreecommitdiffstats
path: root/dom
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-01-22 11:49:38 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-01-22 11:51:19 +0100
commit5a6059feef9d2c7837afa3f87a2a9bfed345bb9d (patch)
tree2dae570a2f1bbaecc250b0f2b67c80e936c3b945 /dom
parent8e33fa9c4b5e4fb3ddfa11b7722cc74df3f94eca (diff)
parentfabe21d593bd09e50ffc9932b074305f15d5409a (diff)
downloadUXP-5a6059feef9d2c7837afa3f87a2a9bfed345bb9d.tar
UXP-5a6059feef9d2c7837afa3f87a2a9bfed345bb9d.tar.gz
UXP-5a6059feef9d2c7837afa3f87a2a9bfed345bb9d.tar.lz
UXP-5a6059feef9d2c7837afa3f87a2a9bfed345bb9d.tar.xz
UXP-5a6059feef9d2c7837afa3f87a2a9bfed345bb9d.zip
Issue #1354 - Fix another potential crashing scenario in WebGL.
(merge of gl-work branch)
Diffstat (limited to 'dom')
-rw-r--r--dom/canvas/WebGLContextValidate.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/dom/canvas/WebGLContextValidate.cpp b/dom/canvas/WebGLContextValidate.cpp
index ebf0aa8c2..30d4c6522 100644
--- a/dom/canvas/WebGLContextValidate.cpp
+++ b/dom/canvas/WebGLContextValidate.cpp
@@ -440,6 +440,13 @@ WebGLContext::InitAndValidateGL(FailureReason* const out_failReason)
{
MOZ_RELEASE_ASSERT(gl, "GFX: GL not initialized");
+ if (!gl->MakeCurrent(true)) {
+ MOZ_ASSERT(false);
+ *out_failReason = { "FEATURE_FAILURE_WEBGL_MAKECURRENT",
+ "Failed to MakeCurrent for init." };
+ return false;
+ }
+
// Unconditionally create a new format usage authority. This is
// important when restoring contexts and extensions need to add
// formats back into the authority.