Skip to content

Commit 378f3cf

Browse files
authored
Merge pull request #550 from kbenzie/benie/fix-coverity-divide-by-zero
[ur] Fix modulo by zero Coverity defect
2 parents e1ad780 + 65bf539 commit 378f3cf

File tree

5 files changed

+88
-60
lines changed

5 files changed

+88
-60
lines changed

include/ur_api.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4931,10 +4931,10 @@ urEnqueueMemBufferWrite(
49314931
/// + `region.width == 0 || region.height == 0 || region.width == 0`
49324932
/// + `bufferRowPitch != 0 && bufferRowPitch < region.width`
49334933
/// + `hostRowPitch != 0 && hostRowPitch < region.width`
4934-
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`
4935-
/// + `bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`
4936-
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`
4937-
/// + `hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`
4934+
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`
4935+
/// + `bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`
4936+
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`
4937+
/// + `hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`
49384938
/// + If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access.
49394939
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
49404940
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
@@ -4996,10 +4996,10 @@ urEnqueueMemBufferReadRect(
49964996
/// + `region.width == 0 || region.height == 0 || region.width == 0`
49974997
/// + `bufferRowPitch != 0 && bufferRowPitch < region.width`
49984998
/// + `hostRowPitch != 0 && hostRowPitch < region.width`
4999-
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`
5000-
/// + `bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`
5001-
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`
5002-
/// + `hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`
4999+
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`
5000+
/// + `bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`
5001+
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`
5002+
/// + `hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`
50035003
/// + If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access.
50045004
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
50055005
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
@@ -5099,10 +5099,10 @@ urEnqueueMemBufferCopy(
50995099
/// + `region.width == 0 || region.height == 0 || region.depth == 0`
51005100
/// + `srcRowPitch != 0 && srcRowPitch < region.height`
51015101
/// + `dstRowPitch != 0 && dstRowPitch < region.height`
5102-
/// + `srcSlicePitch != 0 && srcSlicePitch < region.height * srcRowPitch`
5103-
/// + `srcSlicePitch != 0 && srcSlicePitch % srcRowPitch != 0`
5104-
/// + `dstSlicePitch != 0 && dstSlicePitch < region.height * dstRowPitch`
5105-
/// + `dstSlicePitch != 0 && dstSlicePitch % dstRowPitch != 0`
5102+
/// + `srcSlicePitch != 0 && srcSlicePitch < region.height * (srcRowPitch != 0 ? srcRowPitch : region.width)`
5103+
/// + `srcSlicePitch != 0 && srcSlicePitch % (srcRowPitch != 0 ? srcRowPitch : region.width) != 0`
5104+
/// + `dstSlicePitch != 0 && dstSlicePitch < region.height * (dstRowPitch != 0 ? dstRowPitch : region.width)`
5105+
/// + `dstSlicePitch != 0 && dstSlicePitch % (dstRowPitch != 0 ? dstRowPitch : region.width) != 0`
51065106
/// + If the combination of `srcOrigin`, `region`, `srcRowPitch`, and `srcSlicePitch` results in an out-of-bounds access.
51075107
/// + If the combination of `dstOrigin`, `region`, `dstRowPitch`, and `dstSlicePitch` results in an out-of-bounds access.
51085108
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY

scripts/core/enqueue.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@ returns:
315315
- "`region.width == 0 || region.height == 0 || region.width == 0`"
316316
- "`bufferRowPitch != 0 && bufferRowPitch < region.width`"
317317
- "`hostRowPitch != 0 && hostRowPitch < region.width`"
318-
- "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`"
319-
- "`bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`"
320-
- "`hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`"
321-
- "`hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`"
318+
- "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`"
319+
- "`bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`"
320+
- "`hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`"
321+
- "`hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`"
322322
- "If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access."
323323
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
324324
- $X_RESULT_ERROR_OUT_OF_RESOURCES
@@ -391,10 +391,10 @@ returns:
391391
- "`region.width == 0 || region.height == 0 || region.width == 0`"
392392
- "`bufferRowPitch != 0 && bufferRowPitch < region.width`"
393393
- "`hostRowPitch != 0 && hostRowPitch < region.width`"
394-
- "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`"
395-
- "`bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`"
396-
- "`hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`"
397-
- "`hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`"
394+
- "`bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`"
395+
- "`bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`"
396+
- "`hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`"
397+
- "`hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`"
398398
- "If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access."
399399
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
400400
- $X_RESULT_ERROR_OUT_OF_RESOURCES
@@ -513,10 +513,10 @@ returns:
513513
- "`region.width == 0 || region.height == 0 || region.depth == 0`"
514514
- "`srcRowPitch != 0 && srcRowPitch < region.height`"
515515
- "`dstRowPitch != 0 && dstRowPitch < region.height`"
516-
- "`srcSlicePitch != 0 && srcSlicePitch < region.height * srcRowPitch`"
517-
- "`srcSlicePitch != 0 && srcSlicePitch % srcRowPitch != 0`"
518-
- "`dstSlicePitch != 0 && dstSlicePitch < region.height * dstRowPitch`"
519-
- "`dstSlicePitch != 0 && dstSlicePitch % dstRowPitch != 0`"
516+
- "`srcSlicePitch != 0 && srcSlicePitch < region.height * (srcRowPitch != 0 ? srcRowPitch : region.width)`"
517+
- "`srcSlicePitch != 0 && srcSlicePitch % (srcRowPitch != 0 ? srcRowPitch : region.width) != 0`"
518+
- "`dstSlicePitch != 0 && dstSlicePitch < region.height * (dstRowPitch != 0 ? dstRowPitch : region.width)`"
519+
- "`dstSlicePitch != 0 && dstSlicePitch % (dstRowPitch != 0 ? dstRowPitch : region.width) != 0`"
520520
- "If the combination of `srcOrigin`, `region`, `srcRowPitch`, and `srcSlicePitch` results in an out-of-bounds access."
521521
- "If the combination of `dstOrigin`, `region`, `dstRowPitch`, and `dstSlicePitch` results in an out-of-bounds access."
522522
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,20 +3614,30 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
36143614
}
36153615

36163616
if (bufferSlicePitch != 0 &&
3617-
bufferSlicePitch < region.height * bufferRowPitch) {
3617+
bufferSlicePitch <
3618+
region.height *
3619+
(bufferRowPitch != 0 ? bufferRowPitch : region.width)) {
36183620
return UR_RESULT_ERROR_INVALID_SIZE;
36193621
}
36203622

3621-
if (bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0) {
3623+
if (bufferSlicePitch != 0 &&
3624+
bufferSlicePitch %
3625+
(bufferRowPitch != 0 ? bufferRowPitch : region.width) !=
3626+
0) {
36223627
return UR_RESULT_ERROR_INVALID_SIZE;
36233628
}
36243629

36253630
if (hostSlicePitch != 0 &&
3626-
hostSlicePitch < region.height * hostRowPitch) {
3631+
hostSlicePitch <
3632+
region.height *
3633+
(hostRowPitch != 0 ? hostRowPitch : region.width)) {
36273634
return UR_RESULT_ERROR_INVALID_SIZE;
36283635
}
36293636

3630-
if (hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0) {
3637+
if (hostSlicePitch != 0 &&
3638+
hostSlicePitch %
3639+
(hostRowPitch != 0 ? hostRowPitch : region.width) !=
3640+
0) {
36313641
return UR_RESULT_ERROR_INVALID_SIZE;
36323642
}
36333643
}
@@ -3715,20 +3725,30 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect(
37153725
}
37163726

37173727
if (bufferSlicePitch != 0 &&
3718-
bufferSlicePitch < region.height * bufferRowPitch) {
3728+
bufferSlicePitch <
3729+
region.height *
3730+
(bufferRowPitch != 0 ? bufferRowPitch : region.width)) {
37193731
return UR_RESULT_ERROR_INVALID_SIZE;
37203732
}
37213733

3722-
if (bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0) {
3734+
if (bufferSlicePitch != 0 &&
3735+
bufferSlicePitch %
3736+
(bufferRowPitch != 0 ? bufferRowPitch : region.width) !=
3737+
0) {
37233738
return UR_RESULT_ERROR_INVALID_SIZE;
37243739
}
37253740

37263741
if (hostSlicePitch != 0 &&
3727-
hostSlicePitch < region.height * hostRowPitch) {
3742+
hostSlicePitch <
3743+
region.height *
3744+
(hostRowPitch != 0 ? hostRowPitch : region.width)) {
37283745
return UR_RESULT_ERROR_INVALID_SIZE;
37293746
}
37303747

3731-
if (hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0) {
3748+
if (hostSlicePitch != 0 &&
3749+
hostSlicePitch %
3750+
(hostRowPitch != 0 ? hostRowPitch : region.width) !=
3751+
0) {
37323752
return UR_RESULT_ERROR_INVALID_SIZE;
37333753
}
37343754
}
@@ -3862,19 +3882,27 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect(
38623882
return UR_RESULT_ERROR_INVALID_SIZE;
38633883
}
38643884

3865-
if (srcSlicePitch != 0 && srcSlicePitch < region.height * srcRowPitch) {
3885+
if (srcSlicePitch != 0 &&
3886+
srcSlicePitch < region.height * (srcRowPitch != 0 ? srcRowPitch
3887+
: region.width)) {
38663888
return UR_RESULT_ERROR_INVALID_SIZE;
38673889
}
38683890

3869-
if (srcSlicePitch != 0 && srcSlicePitch % srcRowPitch != 0) {
3891+
if (srcSlicePitch != 0 &&
3892+
srcSlicePitch % (srcRowPitch != 0 ? srcRowPitch : region.width) !=
3893+
0) {
38703894
return UR_RESULT_ERROR_INVALID_SIZE;
38713895
}
38723896

3873-
if (dstSlicePitch != 0 && dstSlicePitch < region.height * dstRowPitch) {
3897+
if (dstSlicePitch != 0 &&
3898+
dstSlicePitch < region.height * (dstRowPitch != 0 ? dstRowPitch
3899+
: region.width)) {
38743900
return UR_RESULT_ERROR_INVALID_SIZE;
38753901
}
38763902

3877-
if (dstSlicePitch != 0 && dstSlicePitch % dstRowPitch != 0) {
3903+
if (dstSlicePitch != 0 &&
3904+
dstSlicePitch % (dstRowPitch != 0 ? dstRowPitch : region.width) !=
3905+
0) {
38783906
return UR_RESULT_ERROR_INVALID_SIZE;
38793907
}
38803908
}

source/loader/ur_libapi.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4006,10 +4006,10 @@ ur_result_t UR_APICALL urEnqueueMemBufferWrite(
40064006
/// + `region.width == 0 || region.height == 0 || region.width == 0`
40074007
/// + `bufferRowPitch != 0 && bufferRowPitch < region.width`
40084008
/// + `hostRowPitch != 0 && hostRowPitch < region.width`
4009-
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`
4010-
/// + `bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`
4011-
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`
4012-
/// + `hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`
4009+
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`
4010+
/// + `bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`
4011+
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`
4012+
/// + `hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`
40134013
/// + If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access.
40144014
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
40154015
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
@@ -4090,10 +4090,10 @@ ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
40904090
/// + `region.width == 0 || region.height == 0 || region.width == 0`
40914091
/// + `bufferRowPitch != 0 && bufferRowPitch < region.width`
40924092
/// + `hostRowPitch != 0 && hostRowPitch < region.width`
4093-
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`
4094-
/// + `bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`
4095-
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`
4096-
/// + `hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`
4093+
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`
4094+
/// + `bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`
4095+
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`
4096+
/// + `hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`
40974097
/// + If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access.
40984098
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
40994099
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
@@ -4227,10 +4227,10 @@ ur_result_t UR_APICALL urEnqueueMemBufferCopy(
42274227
/// + `region.width == 0 || region.height == 0 || region.depth == 0`
42284228
/// + `srcRowPitch != 0 && srcRowPitch < region.height`
42294229
/// + `dstRowPitch != 0 && dstRowPitch < region.height`
4230-
/// + `srcSlicePitch != 0 && srcSlicePitch < region.height * srcRowPitch`
4231-
/// + `srcSlicePitch != 0 && srcSlicePitch % srcRowPitch != 0`
4232-
/// + `dstSlicePitch != 0 && dstSlicePitch < region.height * dstRowPitch`
4233-
/// + `dstSlicePitch != 0 && dstSlicePitch % dstRowPitch != 0`
4230+
/// + `srcSlicePitch != 0 && srcSlicePitch < region.height * (srcRowPitch != 0 ? srcRowPitch : region.width)`
4231+
/// + `srcSlicePitch != 0 && srcSlicePitch % (srcRowPitch != 0 ? srcRowPitch : region.width) != 0`
4232+
/// + `dstSlicePitch != 0 && dstSlicePitch < region.height * (dstRowPitch != 0 ? dstRowPitch : region.width)`
4233+
/// + `dstSlicePitch != 0 && dstSlicePitch % (dstRowPitch != 0 ? dstRowPitch : region.width) != 0`
42344234
/// + If the combination of `srcOrigin`, `region`, `srcRowPitch`, and `srcSlicePitch` results in an out-of-bounds access.
42354235
/// + If the combination of `dstOrigin`, `region`, `dstRowPitch`, and `dstSlicePitch` results in an out-of-bounds access.
42364236
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY

source/ur_api.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3342,10 +3342,10 @@ ur_result_t UR_APICALL urEnqueueMemBufferWrite(
33423342
/// + `region.width == 0 || region.height == 0 || region.width == 0`
33433343
/// + `bufferRowPitch != 0 && bufferRowPitch < region.width`
33443344
/// + `hostRowPitch != 0 && hostRowPitch < region.width`
3345-
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`
3346-
/// + `bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`
3347-
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`
3348-
/// + `hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`
3345+
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`
3346+
/// + `bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`
3347+
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`
3348+
/// + `hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`
33493349
/// + If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access.
33503350
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
33513351
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
@@ -3416,10 +3416,10 @@ ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
34163416
/// + `region.width == 0 || region.height == 0 || region.width == 0`
34173417
/// + `bufferRowPitch != 0 && bufferRowPitch < region.width`
34183418
/// + `hostRowPitch != 0 && hostRowPitch < region.width`
3419-
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * bufferRowPitch`
3420-
/// + `bufferSlicePitch != 0 && bufferSlicePitch % bufferRowPitch != 0`
3421-
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * hostRowPitch`
3422-
/// + `hostSlicePitch != 0 && hostSlicePitch % hostRowPitch != 0`
3419+
/// + `bufferSlicePitch != 0 && bufferSlicePitch < region.height * (bufferRowPitch != 0 ? bufferRowPitch : region.width)`
3420+
/// + `bufferSlicePitch != 0 && bufferSlicePitch % (bufferRowPitch != 0 ? bufferRowPitch : region.width) != 0`
3421+
/// + `hostSlicePitch != 0 && hostSlicePitch < region.height * (hostRowPitch != 0 ? hostRowPitch : region.width)`
3422+
/// + `hostSlicePitch != 0 && hostSlicePitch % (hostRowPitch != 0 ? hostRowPitch : region.width) != 0`
34233423
/// + If the combination of `bufferOrigin`, `region`, `bufferRowPitch`, and `bufferSlicePitch` results in an out-of-bounds access.
34243424
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
34253425
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
@@ -3534,10 +3534,10 @@ ur_result_t UR_APICALL urEnqueueMemBufferCopy(
35343534
/// + `region.width == 0 || region.height == 0 || region.depth == 0`
35353535
/// + `srcRowPitch != 0 && srcRowPitch < region.height`
35363536
/// + `dstRowPitch != 0 && dstRowPitch < region.height`
3537-
/// + `srcSlicePitch != 0 && srcSlicePitch < region.height * srcRowPitch`
3538-
/// + `srcSlicePitch != 0 && srcSlicePitch % srcRowPitch != 0`
3539-
/// + `dstSlicePitch != 0 && dstSlicePitch < region.height * dstRowPitch`
3540-
/// + `dstSlicePitch != 0 && dstSlicePitch % dstRowPitch != 0`
3537+
/// + `srcSlicePitch != 0 && srcSlicePitch < region.height * (srcRowPitch != 0 ? srcRowPitch : region.width)`
3538+
/// + `srcSlicePitch != 0 && srcSlicePitch % (srcRowPitch != 0 ? srcRowPitch : region.width) != 0`
3539+
/// + `dstSlicePitch != 0 && dstSlicePitch < region.height * (dstRowPitch != 0 ? dstRowPitch : region.width)`
3540+
/// + `dstSlicePitch != 0 && dstSlicePitch % (dstRowPitch != 0 ? dstRowPitch : region.width) != 0`
35413541
/// + If the combination of `srcOrigin`, `region`, `srcRowPitch`, and `srcSlicePitch` results in an out-of-bounds access.
35423542
/// + If the combination of `dstOrigin`, `region`, `dstRowPitch`, and `dstSlicePitch` results in an out-of-bounds access.
35433543
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY

0 commit comments

Comments
 (0)