From 5a5811a4f5f9b3c85bc8ff18c7e02e4f6d98e567 Mon Sep 17 00:00:00 2001 From: Herman Semenov Date: Thu, 27 Mar 2025 16:34:49 +0300 Subject: [PATCH] Fixed bug with zero depth ur_rect_region which must be checked before calling func Fixed functions: - urEnqueueMemBufferWriteRect() - urEnqueueMemBufferReadRect() --- scripts/core/enqueue.yml | 4 ++-- source/loader/layers/validation/ur_valddi.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/core/enqueue.yml b/scripts/core/enqueue.yml index cc2597962d..25db36bb8f 100644 --- a/scripts/core/enqueue.yml +++ b/scripts/core/enqueue.yml @@ -328,7 +328,7 @@ returns: - "An event in `phEventWaitList` has $X_EVENT_STATUS_ERROR." - $X_RESULT_ERROR_INVALID_MEM_OBJECT - $X_RESULT_ERROR_INVALID_SIZE: - - "`region.width == 0 || region.height == 0 || region.width == 0`" + - "`region.width == 0 || region.height == 0 || region.depth == 0`" - "`bufferRowPitch != 0 && bufferRowPitch < region.width`" - "`hostRowPitch != 0 && hostRowPitch < region.width`" - "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`" @@ -406,7 +406,7 @@ returns: - "An event in `phEventWaitList` has $X_EVENT_STATUS_ERROR." - $X_RESULT_ERROR_INVALID_MEM_OBJECT - $X_RESULT_ERROR_INVALID_SIZE: - - "`region.width == 0 || region.height == 0 || region.width == 0`" + - "`region.width == 0 || region.height == 0 || region.depth == 0`" - "`bufferRowPitch != 0 && bufferRowPitch < region.width`" - "`hostRowPitch != 0 && hostRowPitch < region.width`" - "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`" diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 5fad247241..b4c65f9509 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -4807,7 +4807,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( if (phEventWaitList != NULL && numEventsInWaitList == 0) return UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST; - if (region.width == 0 || region.height == 0 || region.width == 0) + if (region.width == 0 || region.height == 0 || region.depth == 0) return UR_RESULT_ERROR_INVALID_SIZE; if (bufferRowPitch != 0 && bufferRowPitch < region.width) @@ -4932,7 +4932,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( if (phEventWaitList != NULL && numEventsInWaitList == 0) return UR_RESULT_ERROR_INVALID_EVENT_WAIT_LIST; - if (region.width == 0 || region.height == 0 || region.width == 0) + if (region.width == 0 || region.height == 0 || region.depth == 0) return UR_RESULT_ERROR_INVALID_SIZE; if (bufferRowPitch != 0 && bufferRowPitch < region.width)