Bug 1250710 - Mark specific InvalidEnum case. - r=ethlin
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 04 Jul 2016 21:20:26 -0700
changeset 330420 43608cd94c6fbf3ae49047d529f37e2fe19e8c1c
parent 330419 0a20a55213d28e92a78f8f483aa27c38818732c7
child 330421 e8b72c8f59f987148823e53fbafbbe3cfde05090
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersethlin
bugs1250710
milestone50.0a1
Bug 1250710 - Mark specific InvalidEnum case. - r=ethlin MozReview-Commit-ID: HusUzReTnS6
dom/canvas/WebGLContextGL.cpp
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1616,16 +1616,21 @@ ValidateReadPixelsFormatAndType(const we
     case LOCAL_GL_LUMINANCE:
     case LOCAL_GL_LUMINANCE_ALPHA:
     case LOCAL_GL_DEPTH_COMPONENT:
     case LOCAL_GL_DEPTH_STENCIL:
         webgl->ErrorInvalidEnum("readPixels: Invalid format: 0x%04x", pi.format);
         return false;
     }
 
+    if (pi.type == LOCAL_GL_UNSIGNED_INT_24_8) {
+        webgl->ErrorInvalidEnum("readPixels: Invalid type: 0x%04x", pi.type);
+        return false;
+    }
+
     MOZ_ASSERT(gl->IsCurrent());
     if (gl->IsSupported(gl::GLFeature::ES2_compatibility)) {
         const auto auxFormat = gl->GetIntAs<GLenum>(LOCAL_GL_IMPLEMENTATION_COLOR_READ_FORMAT);
         const auto auxType = gl->GetIntAs<GLenum>(LOCAL_GL_IMPLEMENTATION_COLOR_READ_TYPE);
 
         if (auxFormat && auxType &&
             pi.format == auxFormat && pi.type == auxType)
         {