SWDEV-332603 - Check validity of ihipArrayCreate() first argument
Change-Id: Ifd0bdb5708c110da45e4baa9426cccd749732822
This commit is contained in:
@@ -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) &&
|
||||||
|
|||||||
مرجع در شماره جدید
Block a user