aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorCamillo Lugaresi2010-12-20 01:22:58 +0100
committerMike McQuaid2011-02-12 16:53:53 +0000
commite3029928d243cc26868e1190df17fa94b63bc255 (patch)
treec229727b5b3c2c71056d961cf59cda1356b5f4ee /Library/Formula
parent182da394b8e1b9865b230956299d21953fe73150 (diff)
downloadhomebrew-e3029928d243cc26868e1190df17fa94b63bc255.tar.bz2
fixed crashing bug with some JPEG-2000 files
Closes #3655. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/jasper.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/Library/Formula/jasper.rb b/Library/Formula/jasper.rb
index 41e7f6fb2..14e22ee9e 100644
--- a/Library/Formula/jasper.rb
+++ b/Library/Formula/jasper.rb
@@ -7,6 +7,10 @@ class Jasper <Formula
depends_on 'jpeg'
+ def patches
+ DATA
+ end
+
def install
fails_with_llvm "Undefined symbols when linking", :build => "2326"
system "./configure", "--disable-debug",
@@ -17,3 +21,33 @@ class Jasper <Formula
system "make install"
end
end
+
+# The following patch fixes a bug (still in upstream as of jasper 1.900.1) where an assertion fails
+# when Jasper is fed certain JPEG-2000 files with an alpha channel.
+# see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=469786
+__END__
+diff --git a/src/libjasper/jpc/jpc_dec.c b/src/libjasper/jpc/jpc_dec.c
+index fa72a0e..1f4845f 100644
+--- a/src/libjasper/jpc/jpc_dec.c
++++ b/src/libjasper/jpc/jpc_dec.c
+@@ -1069,12 +1069,18 @@ static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile)
+ /* Apply an inverse intercomponent transform if necessary. */
+ switch (tile->cp->mctid) {
+ case JPC_MCT_RCT:
+- assert(dec->numcomps == 3);
++ if (dec->numcomps != 3 && dec->numcomps != 4) {
++ jas_eprintf("bad number of components (%d)\n", dec->numcomps);
++ return -1;
++ }
+ jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data,
+ tile->tcomps[2].data);
+ break;
+ case JPC_MCT_ICT:
+- assert(dec->numcomps == 3);
++ if (dec->numcomps != 3 && dec->numcomps != 4) {
++ jas_eprintf("bad number of components (%d)\n", dec->numcomps);
++ return -1;
++ }
+ jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data,
+ tile->tcomps[2].data);
+ break;