diff --git a/src/hip_texture.cpp b/src/hip_texture.cpp index 8b335f336f..82bc5b5d8a 100644 --- a/src/hip_texture.cpp +++ b/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); }