mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Fix integer overflow in 1D buffer image tests (#2092)
This commit is contained in:
@@ -182,7 +182,7 @@ int test_copy_image_set_1D_buffer(cl_device_id device, cl_context context,
|
||||
do
|
||||
{
|
||||
imageInfo.width =
|
||||
(size_t)random_log_in_range(16, (int)maxWidth / 32, seed);
|
||||
(size_t)random_log_in_range(16, (int)(maxWidth / 32), seed);
|
||||
|
||||
imageInfo.rowPitch = imageInfo.width * pixelSize + rowPadding;
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@ int test_fill_image_set_1D_buffer(cl_device_id device, cl_context context,
|
||||
do
|
||||
{
|
||||
imageInfo.width =
|
||||
(size_t)random_log_in_range(16, (int)maxWidth / 32, seed);
|
||||
(size_t)random_log_in_range(16, (int)(maxWidth / 32), seed);
|
||||
|
||||
imageInfo.rowPitch = imageInfo.width * pixelSize + rowPadding;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ int test_get_image_info_1D_buffer(cl_device_id device, cl_context context,
|
||||
do
|
||||
{
|
||||
imageInfo.width =
|
||||
(size_t)random_log_in_range(16, (int)maxWidth / 32, seed);
|
||||
(size_t)random_log_in_range(16, (int)(maxWidth / 32), seed);
|
||||
|
||||
imageInfo.rowPitch = imageInfo.width * pixelSize;
|
||||
size_t extraWidth = (int)random_log_in_range(0, 64, seed);
|
||||
|
||||
@@ -230,7 +230,7 @@ int test_read_image_set_1D_buffer(cl_device_id device, cl_context context,
|
||||
do
|
||||
{
|
||||
imageInfo.width =
|
||||
(size_t)random_log_in_range(16, (int)maxWidth / 32, seed);
|
||||
(size_t)random_log_in_range(16, (int)(maxWidth / 32), seed);
|
||||
|
||||
imageInfo.rowPitch = imageInfo.width * pixelSize;
|
||||
if (gEnablePitch)
|
||||
|
||||
@@ -250,7 +250,7 @@ int test_get_image_info_1D_buffer(cl_device_id device, cl_context context,
|
||||
do
|
||||
{
|
||||
imageInfo.width =
|
||||
(size_t)random_log_in_range(16, (int)maxWidth / 32, seed);
|
||||
(size_t)random_log_in_range(16, (int)(maxWidth / 32), seed);
|
||||
|
||||
imageInfo.rowPitch = imageInfo.width * pixelSize;
|
||||
size_t extraWidth = (int)random_log_in_range(0, 64, seed);
|
||||
|
||||
Reference in New Issue
Block a user