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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 2528243002: Fix silent truncations when extracting values from CheckedNumeric (Closed)
Patch Set: pointer math tests 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: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 3424bc2a5310224463bbed535e1e84eed8e336d0..0f12cd4c93d2c81f807d469a9a670f165c6b5f50 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -6327,7 +6327,7 @@ bool GLES2Implementation::PackStringsToBucket(GLsizei count,
const char* func_name) {
DCHECK_LE(0, count);
// Compute the total size.
- base::CheckedNumeric<size_t> total_size = count;
+ base::CheckedNumeric<uint32_t> total_size = count;
total_size += 1;
total_size *= sizeof(GLint);
if (!total_size.IsValid()) {

Powered by Google App Engine
This is Rietveld 408576698