SWDEV-270630 - Added missing nullcheck
Change-Id: I7caf26c59c4660e26b4159da35731c2ce1600819
This commit is contained in:
committad av
Sarbojit Sarkar
förälder
751578a37e
incheckning
5e7ee214ec
@@ -77,6 +77,11 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject,
|
|||||||
amd::Device* device = hip::getCurrentDevice()->devices()[0];
|
amd::Device* device = hip::getCurrentDevice()->devices()[0];
|
||||||
const device::Info& info = device->info();
|
const device::Info& info = device->info();
|
||||||
|
|
||||||
|
// Validate input params
|
||||||
|
if (pTexObject == nullptr || pResDesc == nullptr || pTexDesc == nullptr) {
|
||||||
|
return hipErrorInvalidValue;
|
||||||
|
}
|
||||||
|
|
||||||
// pResViewDesc can only be specified if the type of resource is a HIP array or a HIP mipmapped array.
|
// pResViewDesc can only be specified if the type of resource is a HIP array or a HIP mipmapped array.
|
||||||
if ((pResViewDesc != nullptr) &&
|
if ((pResViewDesc != nullptr) &&
|
||||||
((pResDesc->resType != hipResourceTypeArray) && (pResDesc->resType != hipResourceTypeMipmappedArray))) {
|
((pResDesc->resType != hipResourceTypeArray) && (pResDesc->resType != hipResourceTypeMipmappedArray))) {
|
||||||
|
|||||||
Referens i nytt ärende
Block a user