From c13c5c9476886f4200fd1f40f1d7f618188efabb Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Tue, 24 Jul 2018 12:25:40 +0530 Subject: [PATCH] Null check before setting offset [ROCm/hip commit: bc4cdf7e41e608d26af8acc4d1dfa7937cd84f96] --- projects/hip/src/hip_texture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/hip/src/hip_texture.cpp b/projects/hip/src/hip_texture.cpp index 8b335f336f..82bc5b5d8a 100644 --- a/projects/hip/src/hip_texture.cpp +++ b/projects/hip/src/hip_texture.cpp @@ -676,7 +676,8 @@ hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* auto ctx = ihipGetTlsDefaultCtx(); if (ctx) { - *offset = 0; + if(offset != nullptr) + *offset = 0; } return ihipLogStatus(hip_status); }