Skip to content

Commit

Permalink
fix bad loop increments in p2i() and p2f() (#3932)
Browse files Browse the repository at this point in the history
fix bad loop increments in p2i() and p2f()
  • Loading branch information
hugovk committed Jul 1, 2019
2 parents 9300ced + 0e0afd4 commit eedac36
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libImaging/Convert.c
Expand Up @@ -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));
}
Expand All @@ -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));
}
Expand Down

0 comments on commit eedac36

Please sign in to comment.