summaryrefslogtreecommitdiff
path: root/graphics/jasper/patches
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2017-02-21 18:24:20 +0000
committeradam <adam@pkgsrc.org>2017-02-21 18:24:20 +0000
commit0a57804f3ccc547505646be956a34362ae538773 (patch)
tree958b74dd1d2310d5e26430f4ee4def1f4146d1fb /graphics/jasper/patches
parent3b4217a11a0a28eb69971ffa3625edfbb93afc59 (diff)
downloadpkgsrc-0a57804f3ccc547505646be956a34362ae538773.tar.gz
Changes 2.0.10:
Fixed a problem in the JP2 encoder that caused a null pointer dereference when no ICC profile data is available (e.g., in the case of an unknown color space).
Diffstat (limited to 'graphics/jasper/patches')
-rw-r--r--graphics/jasper/patches/patch-CMakeLists.txt18
-rw-r--r--graphics/jasper/patches/patch-CVE-2016-8654119
-rw-r--r--graphics/jasper/patches/patch-configure341
3 files changed, 18 insertions, 460 deletions
diff --git a/graphics/jasper/patches/patch-CMakeLists.txt b/graphics/jasper/patches/patch-CMakeLists.txt
new file mode 100644
index 00000000000..b06f60c8603
--- /dev/null
+++ b/graphics/jasper/patches/patch-CMakeLists.txt
@@ -0,0 +1,18 @@
+$NetBSD: patch-CMakeLists.txt,v 1.1 2017/02/21 18:24:20 adam Exp $
+
+Remove the weird hack.
+
+--- CMakeLists.txt.orig 2017-02-21 17:54:13.000000000 +0000
++++ CMakeLists.txt
+@@ -55,11 +55,7 @@ set(JAS_SO_MINOR 0)
+ set(JAS_SO_RELEASE 0)
+ # This is a temporary hack for OSX that should be removed when JAS_SO_VERSION
+ # is next incremented.
+-if (MACOSX)
+-set(JAS_SO_NAME "5.${JAS_SO_MINOR}.${JAS_SO_RELEASE}")
+-else()
+ set(JAS_SO_NAME "${JAS_SO_VERSION}.${JAS_SO_MINOR}.${JAS_SO_RELEASE}")
+-endif()
+
+ message("Shared library ABI version: ${JAS_SO_VERSION}")
+ message("Shared library build version: ${JAS_SO_NAME}")
diff --git a/graphics/jasper/patches/patch-CVE-2016-8654 b/graphics/jasper/patches/patch-CVE-2016-8654
deleted file mode 100644
index c3332e1a42f..00000000000
--- a/graphics/jasper/patches/patch-CVE-2016-8654
+++ /dev/null
@@ -1,119 +0,0 @@
-$NetBSD: patch-CVE-2016-8654,v 1.2 2016/12/17 23:10:25 dholland Exp $
-
-From 4a59cfaf9ab3d48fca4a15c0d2674bf7138e3d1a Mon Sep 17 00:00:00 2001
-From: Michael Adams <mdadams@ece.uvic.ca>
-Date: Sat, 26 Nov 2016 20:23:23 -0800
-Subject: [PATCH] Fixed a buffer overrun problem in the QMFB code in the JPC
- codec that was caused by a buffer being allocated with a size that was too
- small in some cases. Added a new regression test case.
-
----
- data/test/bad/PoC1.jpc | Bin 0 -> 233 bytes
- src/libjasper/jpc/jpc_qmfb.c | 28 +++++++++++++++-------------
- 2 files changed, 15 insertions(+), 13 deletions(-)
- create mode 100644 data/test/bad/PoC1.jpc
-
-# diff --git a/data/test/bad/PoC1.jpc b/data/test/bad/PoC1.jpc
-# new file mode 100644
-# index 0000000000000000000000000000000000000000..95239547c40ebd947169f8d87ec399759d1acd3f
-# GIT binary patch
-# literal 233
-# zcmezG|38pHlYx<efuVtcK><X=Km(8g!Vtj7&dB&bh=G@t0i>9PMS)TLe+&alg2Vq5
-# z23-b5=c3falKdho1;;R5FC%XSjbu#)BLf2i9Ux(-;Fy!1uMn15oSC2Ze*yy+*u*jh
-# z#{ZKa{p#MIIpO~#?i1JcuDH+a{XxR{o@qS)=2<S+_kGs5vcd1wR*^ZWYAZ`pBG>(V
-# z>o4CL(REnycXM0m>2?DJ+q$m14-a1!FY%njRQ9-BmDw#gXoZ8CkKEbRXJ=<JubTMl
-# Q@K-MmpN6@L&;H*808TDYDF6Tf
-#
-# literal 0
-# HcmV?d00001
-
-diff --git src/libjasper/jpc/jpc_qmfb.c src/libjasper/jpc/jpc_qmfb.c
-index 45be24e..f26070f 100644
---- src/libjasper/jpc/jpc_qmfb.c
-+++ src/libjasper/jpc/jpc_qmfb.c
-@@ -374,7 +374,7 @@ void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride,
- register jpc_fix_t *dstptr;
- register int n;
- register int m;
-- int hstartcol;
-+ int hstartrow;
-
- /* Get a buffer. */
- if (bufsize > QMFB_SPLITBUFSIZE) {
-@@ -385,9 +385,9 @@ void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride,
- }
-
- if (numrows >= 2) {
-- hstartcol = (numrows + 1 - parity) >> 1;
-- // ORIGINAL (WRONG): m = (parity) ? hstartcol : (numrows - hstartcol);
-- m = numrows - hstartcol;
-+ hstartrow = (numrows + 1 - parity) >> 1;
-+ // ORIGINAL (WRONG): m = (parity) ? hstartrow : (numrows - hstartrow);
-+ m = numrows - hstartrow;
-
- /* Save the samples destined for the highpass channel. */
- n = m;
-@@ -408,7 +408,7 @@ void jpc_qmfb_split_col(jpc_fix_t *a, int numrows, int stride,
- srcptr += stride << 1;
- }
- /* Copy the saved samples into the highpass channel. */
-- dstptr = &a[hstartcol * stride];
-+ dstptr = &a[hstartrow * stride];
- srcptr = buf;
- n = m;
- while (n-- > 0) {
-@@ -439,20 +439,21 @@ void jpc_qmfb_split_colgrp(jpc_fix_t *a, int numrows, int stride,
- register int n;
- register int i;
- int m;
-- int hstartcol;
-+ int hstartrow;
-
- /* Get a buffer. */
- if (bufsize > QMFB_SPLITBUFSIZE) {
-- if (!(buf = jas_alloc2(bufsize, sizeof(jpc_fix_t)))) {
-+ if (!(buf = jas_alloc3(bufsize, JPC_QMFB_COLGRPSIZE,
-+ sizeof(jpc_fix_t)))) {
- /* We have no choice but to commit suicide in this case. */
- abort();
- }
- }
-
- if (numrows >= 2) {
-- hstartcol = (numrows + 1 - parity) >> 1;
-- // ORIGINAL (WRONG): m = (parity) ? hstartcol : (numrows - hstartcol);
-- m = numrows - hstartcol;
-+ hstartrow = (numrows + 1 - parity) >> 1;
-+ // ORIGINAL (WRONG): m = (parity) ? hstartrow : (numrows - hstartrow);
-+ m = numrows - hstartrow;
-
- /* Save the samples destined for the highpass channel. */
- n = m;
-@@ -485,7 +486,7 @@ void jpc_qmfb_split_colgrp(jpc_fix_t *a, int numrows, int stride,
- srcptr += stride << 1;
- }
- /* Copy the saved samples into the highpass channel. */
-- dstptr = &a[hstartcol * stride];
-+ dstptr = &a[hstartrow * stride];
- srcptr = buf;
- n = m;
- while (n-- > 0) {
-@@ -526,7 +527,7 @@ void jpc_qmfb_split_colres(jpc_fix_t *a, int numrows, int numcols,
-
- /* Get a buffer. */
- if (bufsize > QMFB_SPLITBUFSIZE) {
-- if (!(buf = jas_alloc2(bufsize, sizeof(jpc_fix_t)))) {
-+ if (!(buf = jas_alloc3(bufsize, numcols, sizeof(jpc_fix_t)))) {
- /* We have no choice but to commit suicide in this case. */
- abort();
- }
-@@ -721,7 +722,8 @@ void jpc_qmfb_join_colgrp(jpc_fix_t *a, int numrows, int stride,
-
- /* Allocate memory for the join buffer from the heap. */
- if (bufsize > QMFB_JOINBUFSIZE) {
-- if (!(buf = jas_alloc3(bufsize, JPC_QMFB_COLGRPSIZE, sizeof(jpc_fix_t)))) {
-+ if (!(buf = jas_alloc3(bufsize, JPC_QMFB_COLGRPSIZE,
-+ sizeof(jpc_fix_t)))) {
- /* We have no choice but to commit suicide. */
- abort();
- }
diff --git a/graphics/jasper/patches/patch-configure b/graphics/jasper/patches/patch-configure
deleted file mode 100644
index 979e9934dd2..00000000000
--- a/graphics/jasper/patches/patch-configure
+++ /dev/null
@@ -1,341 +0,0 @@
-$NetBSD: patch-configure,v 1.2 2016/12/16 09:44:44 he Exp $
-
-Check for C99 conformance for stdbool.h, don't just test its presence.
-
---- configure.orig 2007-01-19 21:54:48.000000000 +0000
-+++ configure 2007-08-12 20:56:30.000000000 +0000
-@@ -8286,6 +8286,163 @@ fi
-
- fi
-
-+echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
-+echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
-+if test "${ac_cv_header_stdbool_h+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+
-+#include <stdbool.h>
-+#ifndef bool
-+# error bool is not defined
-+#endif
-+#ifndef false
-+# error false is not defined
-+#endif
-+#if false
-+# error false is not 0
-+#endif
-+#ifndef true
-+# error true is not defined
-+#endif
-+#if true != 1
-+# error true is not 1
-+#endif
-+#ifndef __bool_true_false_are_defined
-+# error __bool_true_false_are_defined is not defined
-+#endif
-+
-+ struct s { _Bool s: 1; _Bool t; } s;
-+
-+ char a[true == 1 ? 1 : -1];
-+ char b[false == 0 ? 1 : -1];
-+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-+ char d[(bool) -0.5 == true ? 1 : -1];
-+ bool e = &s;
-+ char f[(_Bool) -0.0 == false ? 1 : -1];
-+ char g[true];
-+ char h[sizeof (_Bool)];
-+ char i[sizeof s.t];
-+
-+int
-+main ()
-+{
-+ return !a + !b + !c + !d + !e + !f + !g + !h + !i;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag"
-+ || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_header_stdbool_h=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_header_stdbool_h=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
-+echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
-+echo "$as_me:$LINENO: checking for _Bool" >&5
-+echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
-+if test "${ac_cv_type__Bool+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+$ac_includes_default
-+int
-+main ()
-+{
-+if ((_Bool *) 0)
-+ return 0;
-+if (sizeof (_Bool))
-+ return 0;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag"
-+ || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_type__Bool=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type__Bool=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-+echo "${ECHO_T}$ac_cv_type__Bool" >&6
-+if test $ac_cv_type__Bool = yes; then
-+
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE__BOOL 1
-+_ACEOF
-+
-+
-+fi
-+
-+if test $ac_cv_header_stdbool_h = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STDBOOL_H 1
-+_ACEOF
-+
-+fi
-
-
-
-@@ -13727,6 +13884,170 @@ _ACEOF
- fi
-
-
-+echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
-+echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
-+if test "${ac_cv_header_stdbool_h+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+
-+#include <stdbool.h>
-+#ifndef bool
-+# error bool is not defined
-+#endif
-+#ifndef false
-+# error false is not defined
-+#endif
-+#if false
-+# error false is not 0
-+#endif
-+#ifndef true
-+# error true is not defined
-+#endif
-+#if true != 1
-+# error true is not 1
-+#endif
-+#ifndef __bool_true_false_are_defined
-+# error __bool_true_false_are_defined is not defined
-+#endif
-+
-+ struct s { _Bool s: 1; _Bool t; } s;
-+
-+ char a[true == 1 ? 1 : -1];
-+ char b[false == 0 ? 1 : -1];
-+ char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-+ char d[(bool) -0.5 == true ? 1 : -1];
-+ bool e = &s;
-+ char f[(_Bool) -0.0 == false ? 1 : -1];
-+ char g[true];
-+ char h[sizeof (_Bool)];
-+ char i[sizeof s.t];
-+
-+int
-+main ()
-+{
-+ return !a + !b + !c + !d + !e + !f + !g + !h + !i;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag"
-+ || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_header_stdbool_h=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_header_stdbool_h=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
-+echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
-+echo "$as_me:$LINENO: checking for _Bool" >&5
-+echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
-+if test "${ac_cv_type__Bool+set}" = set; then
-+ echo $ECHO_N "(cached) $ECHO_C" >&6
-+else
-+ cat >conftest.$ac_ext <<_ACEOF
-+/* confdefs.h. */
-+_ACEOF
-+cat confdefs.h >>conftest.$ac_ext
-+cat >>conftest.$ac_ext <<_ACEOF
-+/* end confdefs.h. */
-+$ac_includes_default
-+int
-+main ()
-+{
-+if ((_Bool *) 0)
-+ return 0;
-+if (sizeof (_Bool))
-+ return 0;
-+ ;
-+ return 0;
-+}
-+_ACEOF
-+rm -f conftest.$ac_objext
-+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-+ (eval $ac_compile) 2>conftest.er1
-+ ac_status=$?
-+ grep -v '^ *+' conftest.er1 >conftest.err
-+ rm -f conftest.er1
-+ cat conftest.err >&5
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); } &&
-+ { ac_try='test -z "$ac_c_werror_flag"
-+ || test ! -s conftest.err'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; } &&
-+ { ac_try='test -s conftest.$ac_objext'
-+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-+ (eval $ac_try) 2>&5
-+ ac_status=$?
-+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
-+ (exit $ac_status); }; }; then
-+ ac_cv_type__Bool=yes
-+else
-+ echo "$as_me: failed program was:" >&5
-+sed 's/^/| /' conftest.$ac_ext >&5
-+
-+ac_cv_type__Bool=no
-+fi
-+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-+fi
-+echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
-+echo "${ECHO_T}$ac_cv_type__Bool" >&6
-+if test $ac_cv_type__Bool = yes; then
-+
-+cat >>confdefs.h <<_ACEOF
-+#define HAVE__BOOL 1
-+_ACEOF
-+
-+
-+fi
-+
-+if test $ac_cv_header_stdbool_h = yes; then
-+
-+cat >>confdefs.h <<\_ACEOF
-+#define HAVE_STDBOOL_H 1
-+_ACEOF
-+
-+fi
-+
-+
-+
-+
-+
-+
-+
- ############################################################
- # Check for header files.
- ############################################################