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

Unified Diff: unit_test/scale_argb_test.cc

Issue 1947783002: If image sizes are greater than 32768, fixed point stepping will overflow an int. This CL changes t… (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: comments updated Created 4 years, 7 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 | « include/libyuv/version.h ('k') | unit_test/scale_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unit_test/scale_argb_test.cc
diff --git a/unit_test/scale_argb_test.cc b/unit_test/scale_argb_test.cc
index e85eb2a5456c1e9ba06245e18690784ad6e2d05d..b1d47a2a34b86cbdb2d609b8f2b1db0c7a73c09a 100644
--- a/unit_test/scale_argb_test.cc
+++ b/unit_test/scale_argb_test.cc
@@ -28,6 +28,10 @@ static int ARGBTestFilter(int src_width, int src_height,
int dst_width, int dst_height,
FilterMode f, int benchmark_iterations,
int disable_cpu_flags, int benchmark_cpu_info) {
+ if (!SizeValid(src_width, src_height, dst_width, dst_height)) {
+ return 0;
+ }
+
int i, j;
const int b = 0; // 128 to test for padding/stride.
int64 src_argb_plane_size = (Abs(src_width) + b * 2) *
@@ -143,6 +147,10 @@ static int TileARGBScale(const uint8* src_argb, int src_stride_argb,
static int ARGBClipTestFilter(int src_width, int src_height,
int dst_width, int dst_height,
FilterMode f, int benchmark_iterations) {
+ if (!SizeValid(src_width, src_height, dst_width, dst_height)) {
+ return 0;
+ }
+
const int b = 128;
int64 src_argb_plane_size = (Abs(src_width) + b * 2) *
(Abs(src_height) + b * 2) * 4;
« no previous file with comments | « include/libyuv/version.h ('k') | unit_test/scale_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698