diff --git a/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc b/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc index 76a005a168a0e4..b63b7c15d42bcd 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.cc @@ -3996,8 +3996,10 @@ bool WebGLImageConversion::ExtractTextureData( data.resize(width * height * bytes_per_pixel); unsigned image_size_in_bytes, skip_size_in_bytes; - ComputeImageSizeInBytes(format, type, width, height, 1, unpack_params, - &image_size_in_bytes, nullptr, &skip_size_in_bytes); + if (ComputeImageSizeInBytes(format, type, width, height, 1, unpack_params, + &image_size_in_bytes, nullptr, + &skip_size_in_bytes) != GL_NO_ERROR) + return false; const uint8_t* src_data = static_cast(pixels); if (skip_size_in_bytes) { src_data += skip_size_in_bytes;