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

Unified Diff: cc/resources/video_resource_updater.cc

Issue 1266103005: cc: Handle overflow/underflow in MathUtil::RoundUp/RoundDown functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small nit. Created 5 years, 4 months 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
« no previous file with comments | « cc/resources/resource_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/video_resource_updater.cc
diff --git a/cc/resources/video_resource_updater.cc b/cc/resources/video_resource_updater.cc
index 88e8360f0b7392b4644a0e4ebb8aef3bec6514db..e5a6c5f01c7987adca04b8aafcb0a8cd92056964 100644
--- a/cc/resources/video_resource_updater.cc
+++ b/cc/resources/video_resource_updater.cc
@@ -311,7 +311,8 @@ VideoFrameExternalResources VideoResourceUpdater::CreateForSoftwarePlanes(
resource_size_pixels.width(), plane_resource.resource_format);
// Use 4-byte row alignment (OpenGL default) for upload performance.
// Assuming that GL_UNPACK_ALIGNMENT has not changed from default.
- size_t upload_image_stride = MathUtil::RoundUp<size_t>(bytes_per_row, 4u);
+ size_t upload_image_stride =
+ MathUtil::UncheckedRoundUp<size_t>(bytes_per_row, 4u);
const uint8_t* pixels;
size_t video_bytes_per_row = ResourceUtil::UncheckedWidthInBytes<size_t>(
« no previous file with comments | « cc/resources/resource_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698