From 860f3ef7887a82ad5bda1e4373db60cd4a322dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20M=2E=20Bravo?= Date: Sat, 20 Oct 2012 08:43:57 -0500 Subject: [PATCH] pil: fix crash in 64-bit mode Closes Homebrew/homebrew#15563. Signed-off-by: Adam Vandenberg --- Formula/pil.rb | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/Formula/pil.rb b/Formula/pil.rb index 323e83ff54..e9865b1e78 100644 --- a/Formula/pil.rb +++ b/Formula/pil.rb @@ -1,15 +1,21 @@ require 'formula' class Pil < Formula - url 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz' homepage 'http://www.pythonware.com/products/pil/' + url 'http://effbot.org/downloads/Imaging-1.1.7.tar.gz' sha1 '76c37504251171fda8da8e63ecb8bc42a69a5c81' option 'with-little-cms', 'Compile with little-cms support.' depends_on :freetype depends_on 'jpeg' => :recommended - depends_on 'little-cms' unless build.include? 'with-little-cms' # => :optional + depends_on 'little-cms'=> :optional unless build.include? 'with-little-cms' + + # The patch is to fix a core dump in Bug in PIL's quantize() with 64 bit architectures. + # http://mail.python.org/pipermail/image-sig/2012-June/007047.html + def patches + DATA + end def install # Find the arch for the Python we are building against. @@ -51,3 +57,16 @@ class Pil < Formula EOS end end + +__END__ +--- a/libImaging/Quant.c ++++ b/libImaging/Quant.c +@@ -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