I found a nasty bug in PIL's quantize(), in Quant.c,
map_image_pixels_from_median_box(), the `int pixelVal;` definition
must be `unsigned long pixelVal;` instead... This was making PIL crash
under certain circumstances in my system (64 bit Mac OS X Lion 10.7.4
using llvm-gcc4.2).

Patch follows:

-------- CUT HERE --------
--- libImaging/Quant.c.orig     2012-06-20 17:53:49.000000000 -0500
+++ libImaging/Quant.c  2012-06-20 17:53:51.000000000 -0500
@@ -914,7 +914,7 @@
    unsigned long bestdist,bestmatch,dist;
    unsigned long initialdist;
    HashTable h2;
-   int pixelVal;
+   unsigned long pixelVal;

    h2=hashtable_new(unshifted_pixel_hash,unshifted_pixel_cmp);
    for (i=0;i<nPixels;i++) {
-------- CUT HERE --------
_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to