SWDEV-475127 - Check if hipBindTextureToArray parameters are null before dereferencing them
Change-Id: Id0173faff0a385d1665194c9033083ef9b2c48b5
[ROCm/clr commit: d7b07b94a0]
Этот коммит содержится в:
@@ -633,12 +633,6 @@ hipError_t hipBindTexture2D(size_t* offset,
|
||||
hipError_t ihipBindTextureToArray(const textureReference* texref,
|
||||
hipArray_const_t array,
|
||||
const hipChannelFormatDesc* desc) {
|
||||
if ((texref == nullptr) ||
|
||||
(array == nullptr) ||
|
||||
(desc == nullptr)) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
// Any previous address or HIP array state associated with the texture reference is superseded by this function.
|
||||
// Any memory previously bound to hTexRef is unbound.
|
||||
// No need to check for errors.
|
||||
@@ -664,6 +658,10 @@ hipError_t hipBindTextureToArray(const textureReference* texref,
|
||||
const hipChannelFormatDesc* desc) {
|
||||
HIP_INIT_API(hipBindTextureToArray, texref, array, desc);
|
||||
|
||||
if ((texref == nullptr) || (array == nullptr) || (desc == nullptr)) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
|
||||
hipDeviceptr_t refDevPtr = nullptr;
|
||||
size_t refDevSize = 0;
|
||||
HIP_RETURN_ONFAIL(PlatformState::instance().getStatGlobalVar(texref, ihipGetDevice(), &refDevPtr,
|
||||
|
||||
Ссылка в новой задаче
Block a user