Skip to content

Commit

Permalink
fix allocSize issue in images/kernel_image_methods/test_1D_buffer.cpp
Browse files Browse the repository at this point in the history
the allocated buffer for image1d_buffer_t was smaller than the requested
image properties (width * pixel_size) would require.
  • Loading branch information
franz committed Aug 29, 2024
1 parent a716218 commit 286c500
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,12 @@ static int test_get_1Dimage_buffer_info_single(cl_context context,
if (gDebugTrace)
log_info(" - Creating 1D image %d ...\n", (int)imageInfo->width);

buffer = clCreateBuffer(
context, flags, imageInfo->width * get_pixel_size(imageInfo->format),
NULL, &error);
buffer = clCreateBuffer(context, flags, imageValues.getSize(),
NULL, &error);
if (error != CL_SUCCESS)
{
log_error("ERROR: Unable to create buffer for 1D image buffer of size "
"%d (%s)",
(int)imageInfo->rowPitch, IGetErrorString(error));
"%zu (%s)", imageValues.getSize(), IGetErrorString(error));
}

image = create_image_1d(context, flags, imageInfo->format, imageInfo->width,
Expand Down

0 comments on commit 286c500

Please sign in to comment.