Bug 1324710 - Fix deqp/functional/gles3/negativestateapi.html - r=daoshengmu. a=gchang
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 19 Dec 2016 23:47:55 -0800
changeset 353139 eb81172cbbbb6042a28106c576433747785d6084
parent 353138 a38cb48ceb9d53e10eb383847e6d1e99c19c0506
child 353140 3d0c87dd2fb7eb06a70dc61ca14632bf0798f1cc
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, gchang
bugs1324710
milestone52.0a2
Bug 1324710 - Fix deqp/functional/gles3/negativestateapi.html - r=daoshengmu. a=gchang MozReview-Commit-ID: 2seTY1tEtvX
dom/canvas/WebGL2ContextUniforms.cpp
dom/canvas/WebGLContextGL.cpp
--- a/dom/canvas/WebGL2ContextUniforms.cpp
+++ b/dom/canvas/WebGL2ContextUniforms.cpp
@@ -177,16 +177,24 @@ WebGL2Context::GetActiveUniforms(JSConte
         return;
 
     if (!ValidateUniformEnum(this, pname, funcName))
         return;
 
     if (!ValidateObject("getActiveUniforms: program", program))
         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;
+        }
+    }
+
     const auto& count = uniformIndices.Length();
 
     JS::Rooted<JSObject*> array(cx, JS_NewArrayObject(cx, count));
     UniquePtr<GLint[]> samples(new GLint[count]);
     if (!array || !samples) {
         ErrorOutOfMemory("%s: Failed to allocate buffers.", funcName);
         return;
     }
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -687,19 +687,16 @@ WebGLContext::GetFramebufferAttachmentPa
         default:
             ErrorInvalidEnum("%s: With the default framebuffer, can only query COLOR, DEPTH,"
                              " or STENCIL for GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",
                              funcName);
             return JS::NullValue();
         }
         return JS::Int32Value(LOCAL_GL_FRAMEBUFFER_DEFAULT);
 
-    case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
-        return JS::NullValue();
-
     ////////////////
 
     case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
     case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
     case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
         if (attachment == LOCAL_GL_BACK)
             return JS::NumberValue(8);
         return JS::NumberValue(0);