2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-10-02 16:53:26 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Jasper < Formula
|
2012-07-18 05:10:11 +00:00
|
|
|
homepage 'http://www.ece.uvic.ca/~frodo/jasper/'
|
2012-11-02 16:28:52 +00:00
|
|
|
url 'http://download.osgeo.org/gdal/jasper-1.900.1.uuid.tar.gz'
|
|
|
|
sha1 'bbf30168ceae74d78e28039972657a90799e68d3'
|
|
|
|
version '1.900.1'
|
2009-10-02 16:53:26 +00:00
|
|
|
|
2012-08-10 05:12:30 +00:00
|
|
|
option :universal
|
|
|
|
|
2009-10-02 16:53:26 +00:00
|
|
|
depends_on 'jpeg'
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2326
|
|
|
|
cause "Undefined symbols when linking"
|
|
|
|
end
|
|
|
|
|
2012-03-17 19:10:48 +00:00
|
|
|
# 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
|
|
|
|
def patches; DATA; end
|
2010-12-20 00:22:58 +00:00
|
|
|
|
2009-10-02 16:53:26 +00:00
|
|
|
def install
|
2012-08-10 05:12:30 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2010-04-01 19:18:28 +00:00
|
|
|
system "./configure", "--disable-debug",
|
2009-10-22 06:57:11 +00:00
|
|
|
"--disable-dependency-tracking",
|
2010-04-01 19:18:28 +00:00
|
|
|
"--enable-shared",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--mandir=#{man}"
|
2009-10-02 16:53:26 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2010-12-20 00:22:58 +00:00
|
|
|
|
|
|
|
__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;
|