Skip to content

Commit

Permalink
kernel_image_methods: Fix size checks in 1Dbuffer case (#2106)
Browse files Browse the repository at this point in the history
Image height is initialized to 0. But the size calculation should assume
a height of 1.
  • Loading branch information
dneto0 authored Nov 5, 2024
1 parent ccd4550 commit 040dc5f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,7 @@ int test_get_image_info_1D_buffer(cl_device_id device, cl_context context,
imageInfo.rowPitch += extraWidth;
} while ((imageInfo.rowPitch % pixelSize) != 0);

size = (cl_ulong)imageInfo.rowPitch * (cl_ulong)imageInfo.height
* 4;
size = (cl_ulong)imageInfo.rowPitch * 4;
} while (size > maxAllocSize || (size * 3) > memSize);

if (gDebugTrace)
Expand Down

0 comments on commit 040dc5f

Please sign in to comment.