diff --git a/projects/clr/hipamd/src/hip_texture.cpp b/projects/clr/hipamd/src/hip_texture.cpp index 76fce9e9e7..446f6ec45e 100644 --- a/projects/clr/hipamd/src/hip_texture.cpp +++ b/projects/clr/hipamd/src/hip_texture.cpp @@ -617,6 +617,13 @@ hipError_t hipBindTexture2D(size_t* offset, size_t pitch) { HIP_INIT_API(hipBindTexture2D, offset, texref, devPtr, desc, width, height, pitch); + if (texref == nullptr) { + HIP_RETURN(hipErrorUnknown); + } + if (devPtr == nullptr) { + HIP_RETURN(hipErrorNotFound); + } + hipDeviceptr_t refDevPtr = nullptr; size_t refDevSize = 0;