Fix a problem where the PCD decoder overruns the shuffle buffer.
See Pillow bug #568:
https://github.com/python-pillow/Pillow/issues/568
with their commit at:
https://github.com/wiredfool/Pillow/commit/ae453aa18b66af54e7ff716f4ccb33adca60afd4
(Pillow is a fork of PIL).
Note that there is no point in pushing the fix upstream to the
PIL community, as that project has been unresponsive. We need
to switch over to using Pillow at some point instead.
--- Imaging-1.1.7/libImaging/PcdDecode.c.orig 2016-02-02 15:45:33.655102971 -0800
+++ Imaging-1.1.7/libImaging/PcdDecode.c 2016-02-02 15:46:00.615105790 -0800
@@ -47,7 +47,7 @@
out[0] = ptr[x];
out[1] = ptr[(x+4*state->xsize)/2];
out[2] = ptr[(x+5*state->xsize)/2];
- out += 4;
+ out += 3;
}
state->shuffle((UINT8*) im->image[state->y],
@@ -62,7 +62,7 @@
out[0] = ptr[x+state->xsize];
out[1] = ptr[(x+4*state->xsize)/2];
out[2] = ptr[(x+5*state->xsize)/2];
- out += 4;
+ out += 3;
}
state->shuffle((UINT8*) im->image[state->y],