SWDEV-332603 - Check validity of ihipArrayCreate() first argument

Change-Id: Ifd0bdb5708c110da45e4baa9426cccd749732822
Este commit está contenido en:
Rakesh Roy
2022-04-20 19:49:30 +05:30
padre 2613ebf157
commit 8ea74366d7
+4
Ver fichero
@@ -866,6 +866,10 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder,
hipError_t ihipArrayCreate(hipArray** array,
const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray,
unsigned int numMipmapLevels) {
if (array == nullptr) {
return hipErrorInvalidValue;
}
// NumChannels specifies the number of packed components per HIP array element; it may be 1, 2, or 4;
if ((pAllocateArray->NumChannels != 1) &&
(pAllocateArray->NumChannels != 2) &&