| Index: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
|
| index 9e0c32178edd900d7a7ea720bb4f424d2f8fc76f..6bb4acfd7b30f0394f1d2a19716b01e9e67bbf33 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
|
| @@ -2660,7 +2660,11 @@ GLenum WebGLImageConversion::computeImageSizeInBytes(
|
| }
|
|
|
| unsigned padding = 0;
|
| - unsigned residual = (checkedValue % params.alignment).ValueOrDie();
|
| + CheckedNumeric<uint32_t> checkedResidual = checkedValue % params.alignment;
|
| + if (!checkedResidual.IsValid()) {
|
| + return GL_INVALID_VALUE;
|
| + }
|
| + unsigned residual = checkedResidual.ValueOrDie();
|
| if (residual) {
|
| padding = params.alignment - residual;
|
| checkedValue += padding;
|
|
|