From 848ae2c06b80b8539ba58df10d438d949ef73319 Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Tue, 12 Jul 2022 08:40:41 -0400 Subject: [PATCH] SWDEV-345021 - add check for pointer add check for pAllocateArray Signed-off-by: sdashmiz Change-Id: I6c91295c1fe4cffdf22f6b8c07fe0a592c2f4f70 --- hipamd/src/hip_memory.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hipamd/src/hip_memory.cpp b/hipamd/src/hip_memory.cpp index 0537949a87..780972ac2b 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -1009,6 +1009,9 @@ hipError_t ihipArrayCreate(hipArray** array, hipError_t hipArrayCreate(hipArray** array, const HIP_ARRAY_DESCRIPTOR* pAllocateArray) { HIP_INIT_API(hipArrayCreate, array, pAllocateArray); + if (pAllocateArray == nullptr) { + return hipErrorInvalidValue; + } CHECK_STREAM_CAPTURE_SUPPORTED(); HIP_ARRAY3D_DESCRIPTOR desc = {pAllocateArray->Width, pAllocateArray->Height,