Skip to content

Commit eedac36

Browse files
authored
fix bad loop increments in p2i() and p2f() (#3932)
fix bad loop increments in p2i() and p2f()
2 parents 9300ced + 0e0afd4 commit eedac36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libImaging/Convert.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static void
10411041
p2i(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
10421042
{
10431043
int x;
1044-
for (x = 0; x < xsize; x++, in += 2, out_ += 4) {
1044+
for (x = 0; x < xsize; x++, out_ += 4) {
10451045
INT32 v = L(&palette[in[x]*4]) / 1000;
10461046
memcpy(out_, &v, sizeof(v));
10471047
}
@@ -1060,7 +1060,7 @@ static void
10601060
p2f(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
10611061
{
10621062
int x;
1063-
for (x = 0; x < xsize; x++, in += 2, out_ += 4) {
1063+
for (x = 0; x < xsize; x++, out_ += 4) {
10641064
FLOAT32 v = L(&palette[in[x]*4]) / 1000.0F;
10651065
memcpy(out_, &v, sizeof(v));
10661066
}

0 commit comments

Comments
 (0)