fix bad loop increments in p2i() and p2f() (#3932)

fix bad loop increments in p2i() and p2f()
This commit is contained in:
Hugo 2019-07-01 22:18:19 +03:00 committed by GitHub
commit eedac360dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1041,7 +1041,7 @@ static void
p2i(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
{
int x;
for (x = 0; x < xsize; x++, in += 2, out_ += 4) {
for (x = 0; x < xsize; x++, out_ += 4) {
INT32 v = L(&palette[in[x]*4]) / 1000;
memcpy(out_, &v, sizeof(v));
}
@ -1060,7 +1060,7 @@ static void
p2f(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
{
int x;
for (x = 0; x < xsize; x++, in += 2, out_ += 4) {
for (x = 0; x < xsize; x++, out_ += 4) {
FLOAT32 v = L(&palette[in[x]*4]) / 1000.0F;
memcpy(out_, &v, sizeof(v));
}