summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmy Winston <amynka@gentoo.org>2016-12-03 11:26:23 +0100
committerAmy Winston <amynka@gentoo.org>2016-12-03 11:26:23 +0100
commitf6d0b15b0e40546b0cb66930e2cd8a95a4001d24 (patch)
tree6773471f7b8c3c23281dc8e4e42b4912d94cb23a
parentapp-crypt/monkeysphere: New upstream version 0.41 (diff)
downloadgentoo-f6d0b15b.tar.gz
gentoo-f6d0b15b.tar.bz2
gentoo-f6d0b15b.zip
sci-libs/gdal: add jasper patch bug #599626
Package-Manager: portage-2.3.0
-rw-r--r--sci-libs/gdal/files/gdal-2.0.2-jasper2.patch62
-rw-r--r--sci-libs/gdal/gdal-2.0.2-r3.ebuild1
2 files changed, 63 insertions, 0 deletions
diff --git a/sci-libs/gdal/files/gdal-2.0.2-jasper2.patch b/sci-libs/gdal/files/gdal-2.0.2-jasper2.patch
new file mode 100644
index 000000000000..a418e4159c0a
--- /dev/null
+++ b/sci-libs/gdal/files/gdal-2.0.2-jasper2.patch
@@ -0,0 +1,62 @@
+diff -urN orig/frmts/jpeg2000/jpeg2000_vsil_io.cpp dwok/frmts/jpeg2000/jpeg2000_vsil_io.cpp
+--- orig/frmts/jpeg2000/jpeg2000_vsil_io.cpp 2016-01-26 16:21:48.000000000 +0100
++++ dwok/frmts/jpeg2000/jpeg2000_vsil_io.cpp 2016-11-16 21:53:15.280302723 +0100
+@@ -179,40 +179,25 @@
+ * Buffer initialization code.
+ \******************************************************************************/
+
+-static void JPEG2000_VSIL_jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf,
+- int bufsize)
++static void JPEG2000_VSIL_jas_stream_initbuf(jas_stream_t *stream, int bufmode)
+ {
+ /* If this function is being called, the buffer should not have been
+ initialized yet. */
+ assert(!stream->bufbase_);
+
+ if (bufmode != JAS_STREAM_UNBUF) {
+- /* The full- or line-buffered mode is being employed. */
+- if (!buf) {
+- /* The caller has not specified a buffer to employ, so allocate
+- one. */
+- if ((stream->bufbase_ = (unsigned char*)jas_malloc(JAS_STREAM_BUFSIZE +
+- JAS_STREAM_MAXPUTBACK))) {
+- stream->bufmode_ |= JAS_STREAM_FREEBUF;
+- stream->bufsize_ = JAS_STREAM_BUFSIZE;
+- } else {
+- /* The buffer allocation has failed. Resort to unbuffered
+- operation. */
+- stream->bufbase_ = stream->tinybuf_;
+- stream->bufsize_ = 1;
+- }
++ if ((stream->bufbase_ = (unsigned char*)jas_malloc(JAS_STREAM_BUFSIZE +
++ JAS_STREAM_MAXPUTBACK))) {
++ stream->bufmode_ |= JAS_STREAM_FREEBUF;
++ stream->bufsize_ = JAS_STREAM_BUFSIZE;
+ } else {
+- /* The caller has specified a buffer to employ. */
+- /* The buffer must be large enough to accommodate maximum
+- putback. */
+- assert(bufsize > JAS_STREAM_MAXPUTBACK);
+- stream->bufbase_ = JAS_CAST(uchar *, buf);
+- stream->bufsize_ = bufsize - JAS_STREAM_MAXPUTBACK;
++ /* The buffer allocation has failed. Resort to unbuffered
++ operation. */
++ stream->bufbase_ = stream->tinybuf_;
++ stream->bufsize_ = 1;
+ }
+ } else {
+ /* The unbuffered mode is being employed. */
+- /* A buffer should not have been supplied by the caller. */
+- assert(!buf);
+ /* Use a trivial one-character buffer. */
+ stream->bufbase_ = stream->tinybuf_;
+ stream->bufsize_ = 1;
+@@ -282,7 +267,7 @@
+ }
+
+ /* By default, use full buffering for this type of stream. */
+- JPEG2000_VSIL_jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
++ JPEG2000_VSIL_jas_stream_initbuf(stream, JAS_STREAM_FULLBUF);
+
+ return stream;
+ }
diff --git a/sci-libs/gdal/gdal-2.0.2-r3.ebuild b/sci-libs/gdal/gdal-2.0.2-r3.ebuild
index 2dae2cd0c96e..f8a672cb9fcd 100644
--- a/sci-libs/gdal/gdal-2.0.2-r3.ebuild
+++ b/sci-libs/gdal/gdal-2.0.2-r3.ebuild
@@ -87,6 +87,7 @@ src_prepare() {
if use jpeg2k; then
epatch "${FILESDIR}"/${P}-jasper.patch
+ epatch "${FILESDIR}"/${P}-jasper2.patch #bug 599626
fi
# -soname is only accepted by GNU ld/ELF