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

Change-Id: Ifd0bdb5708c110da45e4baa9426cccd749732822
Cette révision appartient à :
Rakesh Roy a révisé 2022-04-22 11:08:37 +05:30
1 Parent 2613ebf157
révision 8ea74366d7
1 fichier modifié
+4
+4
Voir le fichier
@@ -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) &&