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

Change-Id: Ifd0bdb5708c110da45e4baa9426cccd749732822
This commit is contained in:
Rakesh Roy
2022-04-20 19:49:30 +05:30
والد 2613ebf157
کامیت 8ea74366d7
@@ -866,6 +866,10 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder,
hipError_t ihipArrayCreate(hipArray** array, hipError_t ihipArrayCreate(hipArray** array,
const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray, const HIP_ARRAY3D_DESCRIPTOR* pAllocateArray,
unsigned int numMipmapLevels) { 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; // NumChannels specifies the number of packed components per HIP array element; it may be 1, 2, or 4;
if ((pAllocateArray->NumChannels != 1) && if ((pAllocateArray->NumChannels != 1) &&
(pAllocateArray->NumChannels != 2) && (pAllocateArray->NumChannels != 2) &&