From 0af33580e63ed2c7a8c7e2161d14edf74473a417 Mon Sep 17 00:00:00 2001 From: Sarbojit Sarkar Date: Thu, 15 Oct 2020 04:26:03 -0400 Subject: [PATCH] SWDEV-256325 : Fix for hipMemset2D crash Change-Id: I1f434602fecd4fb935d2bc72f2c72d6a2d4c45fe --- rocclr/hip_memory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rocclr/hip_memory.cpp b/rocclr/hip_memory.cpp index 75f9fe3426..87064b8ee1 100755 --- a/rocclr/hip_memory.cpp +++ b/rocclr/hip_memory.cpp @@ -1855,6 +1855,10 @@ hipError_t ihipMemset3D(hipPitchedPtr pitchedDevPtr, auto sizeBytes = extent.width * extent.height * extent.depth; + if (sizeBytes == 0) { + // sizeBytes is zero hence returning early as nothing to be set + return hipSuccess; + } if (memory == nullptr) { return hipErrorInvalidValue; }