kernel_image_methods: Fix size checks in 1Dbuffer case (#2106)

Image height is initialized to 0. But the size calculation should assume
a height of 1.
This commit is contained in:
David Neto
2024-11-05 11:53:27 -05:00
committed by GitHub
parent ccd455040a
commit 040dc5f69e

View File

@@ -262,8 +262,7 @@ int test_get_image_info_1D_buffer(cl_device_id device, cl_context context,
imageInfo.rowPitch += extraWidth; imageInfo.rowPitch += extraWidth;
} while ((imageInfo.rowPitch % pixelSize) != 0); } while ((imageInfo.rowPitch % pixelSize) != 0);
size = (cl_ulong)imageInfo.rowPitch * (cl_ulong)imageInfo.height size = (cl_ulong)imageInfo.rowPitch * 4;
* 4;
} while (size > maxAllocSize || (size * 3) > memSize); } while (size > maxAllocSize || (size * 3) > memSize);
if (gDebugTrace) if (gDebugTrace)