diff --git a/projects/clr/hipamd/rocclr/hip_memory.cpp b/projects/clr/hipamd/rocclr/hip_memory.cpp index af4e368d2f..ab3518e9b3 100755 --- a/projects/clr/hipamd/rocclr/hip_memory.cpp +++ b/projects/clr/hipamd/rocclr/hip_memory.cpp @@ -421,7 +421,7 @@ hipError_t ihipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t heigh return hipErrorInvalidValue; } - if ((width == 0) || (height == 0)) { + if ((width == 0) || (height == 0) || (depth == 0)) { *ptr = nullptr; return hipSuccess; }