diff --git a/PVRTCEncoder/src/Indexer.h b/PVRTCEncoder/src/Indexer.h index da4537b..2253183 100644 --- a/PVRTCEncoder/src/Indexer.h +++ b/PVRTCEncoder/src/Indexer.h @@ -76,7 +76,7 @@ class Indexer { int32 r; switch(m_WrapMode) { case eWrapMode_Clamp: - r = static_cast(std::max(0, std::min(i, l))); + r = static_cast(std::max(0, std::min(i, l-1))); break; case eWrapMode_Wrap: