Module: Mesa
Branch: master
Commit: 9583ce04db3ac4d892eedfcc635c86eca41958d4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9583ce04db3ac4d892eedfcc635c86eca41958d4

Author: Serge Martin <[email protected]>
Date:   Sun Oct 11 22:24:26 2020 +0200

clover: validate image_row_pitch and image_slice_pitch in clEnqueueMapImage

v2 (Karol Herbst): remove filling values as it was incorrect.

Reviewed-by: Dave Airlie <[email protected]>
Reviewed-by: Karol Herbst <[email protected]>
Reviewed-by: Francisco Jerez <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7069>

---

 src/gallium/frontends/clover/api/transfer.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/gallium/frontends/clover/api/transfer.cpp 
b/src/gallium/frontends/clover/api/transfer.cpp
index fdf2716c6a9..1d9663a9d53 100644
--- a/src/gallium/frontends/clover/api/transfer.cpp
+++ b/src/gallium/frontends/clover/api/transfer.cpp
@@ -838,6 +838,12 @@ clEnqueueMapImage(cl_command_queue d_q, cl_mem d_mem, 
cl_bool blocking,
    validate_object(q, img, origin, region);
    validate_map_flags(img, flags);
 
+   if (!row_pitch)
+      throw error(CL_INVALID_VALUE);
+
+   if (img.slice_pitch() && !slice_pitch)
+      throw error(CL_INVALID_VALUE);
+
    void *map = img.resource_in(q).add_map(q, flags, blocking, origin, region);
 
    auto hev = create<hard_event>(q, CL_COMMAND_MAP_IMAGE, deps);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to