From cf57f204074fa5b79670c6556481a7f70c6d7809 Mon Sep 17 00:00:00 2001 From: Jaydeep Patel Date: Mon, 22 Aug 2022 06:25:03 +0000 Subject: [PATCH] SWDEV-351282 - Null check for desc. Change-Id: I69d534b6f97442c69b66154476a2637e99c3df77 --- 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 4b171e9aa9..494ba8ddcc 100644 --- a/hipamd/src/hip_memory.cpp +++ b/hipamd/src/hip_memory.cpp @@ -1043,6 +1043,9 @@ hipError_t hipArray3DCreate(hipArray** array, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray) { HIP_INIT_API(hipArray3DCreate, array, pAllocateArray); CHECK_STREAM_CAPTURE_SUPPORTED(); + if (pAllocateArray == nullptr) { + HIP_RETURN(hipErrorInvalidValue); + } HIP_RETURN(ihipArrayCreate(array, pAllocateArray, 0 /* numMipLevels */)); }