Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp

Issue 2540153003: Fix WebGL use of base/numerics (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a13f26e72adea0c470ea0d7b7593747073c54a26..9e0c32178edd900d7a7ea720bb4f424d2f8fc76f 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -2660,7 +2660,7 @@ GLenum WebGLImageConversion::computeImageSizeInBytes(
}
unsigned padding = 0;
- unsigned residual = checkedValue.ValueOrDie() % params.alignment;
+ unsigned residual = (checkedValue % params.alignment).ValueOrDie();
Ken Russell (switch to Gerrit) 2016/11/30 21:50:17 Same here.
if (residual) {
padding = params.alignment - residual;
checkedValue += padding;
@@ -2675,7 +2675,7 @@ GLenum WebGLImageConversion::computeImageSizeInBytes(
rows += height;
if (!rows.IsValid())
return GL_INVALID_VALUE;
- checkedValue *= (rows.ValueOrDie() - 1);
+ checkedValue *= (rows - 1);
// Last row is not affected by ROW_LENGTH parameter.
checkedValue += lastRowSize;
if (!checkedValue.IsValid())

Powered by Google App Engine
This is Rietveld 408576698