diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 6cbb1a932d..560cac3b30 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -6533,14 +6533,7 @@ bool GLES2Implementation::ValidateSize(const char* func, GLsizeiptr size) { } bool GLES2Implementation::ValidateOffset(const char* func, GLintptr offset) { - if (offset < 0) { - SetGLError(GL_INVALID_VALUE, func, "offset < 0"); - return false; - } - if (!base::IsValueInRangeForNumericType(offset)) { - SetGLError(GL_INVALID_OPERATION, func, "offset more than 32-bit"); - return false; - } + // Compromised renderer: allow offsets above INT_MAX to reach the GPU process. return true; } diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc index 5e90250d5c..b7571e03f2 100644 --- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc +++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc @@ -5638,18 +5638,14 @@ bool WebGLRenderingContextBase::ValidateValueFitNonNegInt32( const char* function_name, const char* param_name, int64_t value) { + // Compromised renderer: remove the upper-bound check so that offsets above + // INT_MAX pass through to the GPU command buffer. if (value < 0) { String error_msg = StrCat({param_name, " < 0"}); SynthesizeGLError(GL_INVALID_VALUE, function_name, error_msg.Ascii().c_str()); return false; } - if (value > static_cast(std::numeric_limits::max())) { - String error_msg = StrCat({param_name, " more than 32-bit"}); - SynthesizeGLError(GL_INVALID_OPERATION, function_name, - error_msg.Ascii().c_str()); - return false; - } return true; }