mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-10 00:20:57 +03:00
fix bad loop increments in p2i() and p2f() (#3932)
fix bad loop increments in p2i() and p2f()
This commit is contained in:
commit
eedac360dc
|
@ -1041,7 +1041,7 @@ static void
|
||||||
p2i(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
|
p2i(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
|
||||||
{
|
{
|
||||||
int x;
|
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;
|
INT32 v = L(&palette[in[x]*4]) / 1000;
|
||||||
memcpy(out_, &v, sizeof(v));
|
memcpy(out_, &v, sizeof(v));
|
||||||
}
|
}
|
||||||
|
@ -1060,7 +1060,7 @@ static void
|
||||||
p2f(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
|
p2f(UINT8* out_, const UINT8* in, int xsize, const UINT8* palette)
|
||||||
{
|
{
|
||||||
int x;
|
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;
|
FLOAT32 v = L(&palette[in[x]*4]) / 1000.0F;
|
||||||
memcpy(out_, &v, sizeof(v));
|
memcpy(out_, &v, sizeof(v));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user