Bug 1250710 - Mark specific InvalidEnum case. - r=jrmuizel draft
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 04 Jul 2016 21:20:26 -0700
changeset 383818 e90b817334db2438cbaac7ed25ece1ba0d49a138
parent 383817 68bba7a434daa111daf5e7ed271e464a9f1a153a
child 383828 7e264d3d2f540722ea825dfc6eee9d68d4b3a16f
push id22101
push userbmo:jgilbert@mozilla.com
push dateTue, 05 Jul 2016 04:23:13 +0000
reviewersjrmuizel
bugs1250710
milestone50.0a1
Bug 1250710 - Mark specific InvalidEnum case. - r=jrmuizel MozReview-Commit-ID: HusUzReTnS6
dom/canvas/WebGLContextGL.cpp
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1613,16 +1613,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)
         {