From 87862528beef6fbdf3d035fa66c92bbaa95722b0 Mon Sep 17 00:00:00 2001 From: Sarbojit Sarkar Date: Mon, 6 Sep 2021 11:20:17 +0000 Subject: [PATCH] SWDEV-276319 - Added missing null check Change-Id: I0fcaa55b9a793cbb6c1d2f3022edf288dabea757 [ROCm/clr commit: 88186db4cda073ff8033eae657e8f1ceb2704729] --- projects/clr/hipamd/src/hip_memory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/clr/hipamd/src/hip_memory.cpp b/projects/clr/hipamd/src/hip_memory.cpp index 0aed8e2318..04363363ec 100644 --- a/projects/clr/hipamd/src/hip_memory.cpp +++ b/projects/clr/hipamd/src/hip_memory.cpp @@ -1682,6 +1682,9 @@ inline hipError_t ihipMemcpyCmdEnqueue(amd::Command* command, bool isAsync = fal hipError_t ihipMemcpyParam3D(const HIP_MEMCPY3D* pCopy, hipStream_t stream, bool isAsync = false) { amd::Command* command; hipError_t status; + if (pCopy == nullptr || !hip::isValid(stream)) { + return hipErrorInvalidValue; + } if (pCopy->WidthInBytes == 0 || pCopy->Height == 0 || pCopy->Depth == 0) { LogPrintfInfo("Either Width :%d or Height: %d and Depth: %d is zero", pCopy->WidthInBytes, pCopy->Height, pCopy->Depth);