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
This commit is contained in:
NRK 2022-10-09 12:56:57 +06:00 committed by Kim Woelders
parent 280573e6e2
commit e9c09deb08
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}
}
}