From 1ff4db1935111593540dd0e1341cb89aa7a67b36 Mon Sep 17 00:00:00 2001 From: Aaron Watry Date: Tue, 5 Nov 2019 22:26:58 -0600 Subject: [PATCH] clover: Fix incorrect error check in clGetSupportedImageFormats From CL1.2 Section 5.3.2: returns CL_INVALID_VALUE ... if num_entries is 0 and image_formats is not NULL. We were checking the num_image_formats param, not num_entries. Signed-off-by: Aaron Watry Reviewed-by: Dave Airlie Reviewed-by: Karol Herbst Reviewed-by: Francisco Jerez Part-of: --- src/gallium/frontends/clover/api/memory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/clover/api/memory.cpp b/src/gallium/frontends/clover/api/memory.cpp index ccf5edf620e..cf29657f675 100644 --- a/src/gallium/frontends/clover/api/memory.cpp +++ b/src/gallium/frontends/clover/api/memory.cpp @@ -260,7 +260,7 @@ clGetSupportedImageFormats(cl_context d_ctx, cl_mem_flags flags, validate_flags(NULL, flags, false); - if (r_buf && !r_count) + if (r_buf && !count) throw error(CL_INVALID_VALUE); if (r_buf)