Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel_image_methods: Fix size checks in 1Dbuffer case #2106

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imageInfo.height is initialized to 0 earlier, so the loop exits right away. The loop has not been doing anything useful. Change the calculation to use an assumed height of 1.

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

if (gDebugTrace)
Expand Down
Loading