From 4264ff39de316d69f5dff274745bb91f08d4437e Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 8 Oct 2024 14:00:04 -0400 Subject: [PATCH] kernel_image_methods: Fix size checks in 1Dbuffer case Image height is initialized to 0. But the size calculation should assume a height of 1. --- .../images/kernel_image_methods/test_1D_buffer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test_conformance/images/kernel_image_methods/test_1D_buffer.cpp b/test_conformance/images/kernel_image_methods/test_1D_buffer.cpp index 5430f873df..a10d06f4c5 100644 --- a/test_conformance/images/kernel_image_methods/test_1D_buffer.cpp +++ b/test_conformance/images/kernel_image_methods/test_1D_buffer.cpp @@ -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)