diff --git a/ChangeLog b/ChangeLog index 71e0a85..664b324 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ NVIDIA Texture Tools version 2.0.4 * Fix error in RGB format output; reported by jonsoh. See issue 49. * Added support RGB format dithering by jonsoh. Fixes issue 50 and 51. + * Prevent infinite loop in indexMirror when width equal 1. Fixes issue 65. NVIDIA Texture Tools version 2.0.3 * More accurate DXT3 compressor. Fixes issue 38. diff --git a/src/nvimage/FloatImage.h b/src/nvimage/FloatImage.h index b51a0d6..20fa468 100644 --- a/src/nvimage/FloatImage.h +++ b/src/nvimage/FloatImage.h @@ -226,11 +226,15 @@ inline uint FloatImage::indexRepeat(int x, int y) const inline uint FloatImage::indexMirror(int x, int y) const { + if (m_width == 1) x = 0; + x = abs(x); while (x >= m_width) { x = abs(m_width + m_width - x - 2); } + if (m_height == 1) y = 0; + y = abs(y); while (y >= m_height) { y = abs(m_height + m_height - y - 2);