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

Change-Id: Ifd0bdb5708c110da45e4baa9426cccd749732822
Этот коммит содержится в:
Rakesh Roy committed 2022-04-22 11:08:37 +05:30
1 родитель 2613ebf157
Коммит 8ea74366d7
1 file changed
+4
+4
Просмотреть файл
@@ -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) &&