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:
parent
280573e6e2
commit
e9c09deb08
|
@ -481,9 +481,9 @@ tgaflip(uint32_t * in, int w, int h, int fliph, int flipv)
|
||||||
x2 = fliph ? w - 1 : 0;
|
x2 = fliph ? w - 1 : 0;
|
||||||
for (x = 0; x < nx; x++, x2 += dx)
|
for (x = 0; x < nx; x++, x2 += dx)
|
||||||
{
|
{
|
||||||
tmp = in[y * h + x];
|
tmp = in[y * w + x];
|
||||||
in[y * h + x] = in[y2 * h + x2];
|
in[y * w + x] = in[y2 * w + x2];
|
||||||
in[y2 * h + x2] = tmp;
|
in[y2 * w + x2] = tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue