From ade704dd2f871e7773be88cad36caeb97f041ba7 Mon Sep 17 00:00:00 2001 From: Pengda Xie Date: Tue, 28 Jan 2025 15:49:14 -0800 Subject: [PATCH] SWDEV-512044 - Fix logic error in texture size validation Change-Id: I6aefcfed25b099c17bf0856d621081c0a5ce46c5 --- hipamd/src/hip_texture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_texture.cpp b/hipamd/src/hip_texture.cpp index df33a83742..f0d433d0f3 100644 --- a/hipamd/src/hip_texture.cpp +++ b/hipamd/src/hip_texture.cpp @@ -147,8 +147,8 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject, if ((pResDesc->resType == hipResourceTypePitch2D) && ((pResDesc->res.pitch2D.devPtr == nullptr) || (!amd::isMultipleOf(pResDesc->res.pitch2D.devPtr, info.imageBaseAddressAlignment_)) || - (pResDesc->res.pitch2D.width >= info.image2DMaxWidth_) || - (pResDesc->res.pitch2D.height >= info.image2DMaxHeight_) || + (pResDesc->res.pitch2D.width > info.image2DMaxWidth_) || + (pResDesc->res.pitch2D.height > info.image2DMaxHeight_) || (!amd::isMultipleOf(pResDesc->res.pitch2D.pitchInBytes, info.imagePitchAlignment_)))) { // TODO check pitch limits. return hipErrorInvalidValue;