Bug 1444252 - Check if program is linked in GetActiveUniforms. - r=kvark
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 26 Feb 2018 12:03:55 -0800
changeset 407422 f96e8d3c02251534d208bafb046d007970e284a5
parent 407421 7e197166f04eef36c755602152dd191a85d9915c
child 407423 39e131181d442409a5df2ed945c02aca2b9baca2
push id100681
push userjgilbert@mozilla.com
push dateFri, 09 Mar 2018 22:57:14 +0000
treeherdermozilla-inbound@f96e8d3c0225 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskvark
bugs1444252
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1444252 - Check if program is linked in GetActiveUniforms. - r=kvark MozReview-Commit-ID: EBbgWlzdC3A
dom/canvas/WebGL2ContextUniforms.cpp
--- a/dom/canvas/WebGL2ContextUniforms.cpp
+++ b/dom/canvas/WebGL2ContextUniforms.cpp
@@ -167,16 +167,21 @@ WebGL2Context::GetActiveUniforms(JSConte
         return;
 
     if (!ValidateUniformEnum(this, pname, funcName))
         return;
 
     if (!ValidateObject("getActiveUniforms: program", program))
         return;
 
+    if (!program.IsLinked()) {
+        ErrorInvalidOperation("%s: `program` must be linked.", funcName);
+        return;
+    }
+
     const auto& numActiveUniforms = program.LinkInfo()->uniforms.size();
     for (const auto& curIndex : uniformIndices) {
         if (curIndex >= numActiveUniforms) {
             ErrorInvalidValue("%s: Too-large active uniform index queried.", funcName);
             return;
         }
     }