This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit e9c09deb08047c9e902ce37144e82b6edb8aedb6
Author: NRK <[email protected]>
AuthorDate: Sun Oct 9 12:56:57 2022 +0600

    TGA loader: fix indexing in tgaflip
    
    `y` needs to be multiplied by the width, not the height.
    
    ref: https://codeberg.org/nsxiv/nsxiv/issues/378
---
 src/modules/loaders/loader_tga.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/modules/loaders/loader_tga.c b/src/modules/loaders/loader_tga.c
index 992a8d8..e0312fa 100644
--- a/src/modules/loaders/loader_tga.c
+++ b/src/modules/loaders/loader_tga.c
@@ -481,9 +481,9 @@ tgaflip(uint32_t * in, int w, int h, int fliph, int flipv)
         x2 = fliph ? w - 1 : 0;
         for (x = 0; x < nx; x++, x2 += dx)
           {
-             tmp = in[y * h + x];
-             in[y * h + x] = in[y2 * h + x2];
-             in[y2 * h + x2] = tmp;
+             tmp = in[y * w + x];
+             in[y * w + x] = in[y2 * w + x2];
+             in[y2 * w + x2] = tmp;
           }
      }
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to