From ccc73a9fb4bfa41330be710fb77b06b41994bcea Mon Sep 17 00:00:00 2001 From: Vladislav Sytchenko Date: Tue, 25 Feb 2020 13:50:34 -0500 Subject: [PATCH] hipBindTexture() should handle nullptr offset. If a user passes a ptr that was allocated by hipMalloc(), the offset is guaranteed to be 0 and NULL may be passed as the offset parameter. We shouldn't return an error in this case. Change-Id: I4a8d645121e5a17d5e2861a0629356a3599de9ee --- vdi/hip_texture.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vdi/hip_texture.cpp b/vdi/hip_texture.cpp index 634c83557c..bab61340ca 100644 --- a/vdi/hip_texture.cpp +++ b/vdi/hip_texture.cpp @@ -388,8 +388,7 @@ hipError_t ihipBindTexture(size_t* offset, const hipChannelFormatDesc* desc, size_t size, hipTextureReadMode readMode) { - if ((offset == nullptr) || - (texref == nullptr) || + if ((texref == nullptr) || (devPtr == nullptr) || (desc == nullptr)) { return hipErrorInvalidValue; @@ -426,8 +425,7 @@ hipError_t ihipBindTexture2D(size_t* offset, size_t height, size_t pitch, hipTextureReadMode readMode) { - if ((offset == nullptr) || - (texref == nullptr) || + if ((texref == nullptr) || (devPtr == nullptr) || (desc == nullptr)) { return hipErrorInvalidValue;