From 040dc5f69e70092e0f0e07328bc85ba446f063d5 Mon Sep 17 00:00:00 2001 From: David Neto Date: Tue, 5 Nov 2024 11:53:27 -0500 Subject: [PATCH] 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. --- .../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 2e10d975..c8f73a34 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)