From ff253a279c96a33e336f8739f3a370cbc6a2ada6 Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Tue, 3 Jul 2018 08:54:17 +0530 Subject: [PATCH] Fixed offset null check in bind texture functions [ROCm/hip commit: feff0aeea4622a3a03bd2aeb739604928db1ec70] --- projects/hip/src/hip_texture.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/projects/hip/src/hip_texture.cpp b/projects/hip/src/hip_texture.cpp index 24c6eef3af..d6caf853de 100644 --- a/projects/hip/src/hip_texture.cpp +++ b/projects/hip/src/hip_texture.cpp @@ -389,7 +389,8 @@ hipError_t ihipBindTextureImpl(int dim, enum hipTextureReadMode readMode, size_t enum hipTextureFilterMode filterMode = tex->filterMode; int normalizedCoords = tex->normalized; hipTextureObject_t& textureObject = tex->textureObject; - *offset = 0; + if(offset != nullptr) + *offset = 0; auto ctx = ihipGetTlsDefaultCtx(); if (ctx) { hc::accelerator acc = ctx->getDevice()->_acc; @@ -459,7 +460,8 @@ hipError_t ihipBindTexture2DImpl(int dim, enum hipTextureReadMode readMode, size enum hipTextureFilterMode filterMode = tex->filterMode; int normalizedCoords = tex->normalized; hipTextureObject_t& textureObject = tex->textureObject; - *offset = 0; + if(offset != nullptr) + *offset = 0; auto ctx = ihipGetTlsDefaultCtx(); if (ctx) { hc::accelerator acc = ctx->getDevice()->_acc;