Bug 1444252 - Check if program is linked in GetActiveUniforms. - r=kvark
☠☠ backed out by 8d1bb9132686 ☠ ☠
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 26 Feb 2018 12:03:55 -0800
changeset 462448 40063d96ba8eb7efa2051759576ed1d1ac62f55b
parent 462447 09ecb6d589490df1abb869bf025ce094ba87bcac
child 462449 fbd684e1f9f0048a4058c0c090d0e3d17f477aee
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [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;
         }
     }