Index: head/graphics/jasper/Makefile =================================================================== --- head/graphics/jasper/Makefile (revision 395526) +++ head/graphics/jasper/Makefile (revision 395527) @@ -1,48 +1,48 @@ # Created by: Maxim Sobolev # $FreeBSD$ PORTNAME= jasper PORTVERSION= 1.900.1 -PORTREVISION= 14 +PORTREVISION= 15 CATEGORIES= graphics MASTER_SITES= http://www.ece.uvic.ca/~mdadams/jasper/software/ \ ftp://ftp.imagemagick.org/pub/ImageMagick/delegates/ MAINTAINER= dinoex@FreeBSD.org COMMENT= Implementation of the codec specified in the JPEG-2000 standard LICENSE= MIT -USES= jpeg libtool:keepla zip +USES= zip libtool:keepla jpeg GNU_CONFIGURE= yes CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib CONFIGURE_ARGS= --enable-shared --enable-static USE_LDCONFIG= yes OPTIONS_DEFINE= OPENGL UUID DOCS UUID_DESC= UUID support (required by GDAL) .include .if ${PORT_OPTIONS:MOPENGL} USE_XORG= x11 xmu xi xext USE_GL= glut CONFIGURE_ARGS+=--enable-opengl PLIST_SUB+= OPENGL="" .else CONFIGURE_ARGS+=--disable-opengl PLIST_SUB+= OPENGL="@comment " .endif .if ${PORT_OPTIONS:MUUID} EXTRA_PATCHES+= ${FILESDIR}/uuid.patch .endif .if ${PORT_OPTIONS:MDOCS} post-install: ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR}/ .endif .include Index: head/graphics/jasper/files/patch-jas_stream.c =================================================================== --- head/graphics/jasper/files/patch-jas_stream.c (revision 395526) +++ head/graphics/jasper/files/patch-jas_stream.c (revision 395527) @@ -1,30 +1,75 @@ --- src/libjasper/base/jas_stream.c.orig 2007-01-19 22:43:05.000000000 +0100 -+++ src/libjasper/base/jas_stream.c 2013-04-17 21:57:41.000000000 +0200 ++++ src/libjasper/base/jas_stream.c 2015-08-29 08:07:01.000000000 +0200 +@@ -99,7 +99,7 @@ + static void jas_stream_destroy(jas_stream_t *stream); + static jas_stream_t *jas_stream_create(void); + static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf, +- int bufsize); ++ size_t bufsize); + + static int mem_read(jas_stream_obj_t *obj, char *buf, int cnt); + static int mem_write(jas_stream_obj_t *obj, char *buf, int cnt); +@@ -168,7 +168,7 @@ + return stream; + } + +-jas_stream_t *jas_stream_memopen(char *buf, int bufsize) ++jas_stream_t *jas_stream_memopen(char *buf, size_t bufsize) + { + jas_stream_t *stream; + jas_stream_memobj_t *obj; @@ -361,15 +361,14 @@ } obj->fd = -1; obj->flags = 0; - obj->pathname[0] = '\0'; + snprintf(obj->pathname, sizeof(obj->pathname), "/tmp/jasper.XXXXXX"); stream->obj_ = obj; /* Choose a file name. */ - tmpnam(obj->pathname); + obj->fd = mkstemp(obj->pathname); /* Open the underlying file. */ - if ((obj->fd = open(obj->pathname, O_CREAT | O_EXCL | O_RDWR | O_TRUNC | O_BINARY, - JAS_STREAM_PERMS)) < 0) { + if (obj->fd < 0) { jas_stream_destroy(stream); return 0; } @@ -553,7 +552,7 @@ int ret; va_start(ap, fmt); - ret = vsprintf(buf, fmt, ap); + ret = vsnprintf(buf, sizeof(buf), fmt, ap); jas_stream_puts(stream, buf); va_end(ap); return ret; +@@ -570,7 +569,7 @@ + return 0; + } + +-char *jas_stream_gets(jas_stream_t *stream, char *buf, int bufsize) ++char *jas_stream_gets(jas_stream_t *stream, char *buf, size_t bufsize) + { + int c; + char *bufptr; +@@ -694,7 +693,7 @@ + \******************************************************************************/ + + static void jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf, +- int bufsize) ++ size_t bufsize) + { + /* If this function is being called, the buffer should not have been + initialized yet. */ +@@ -987,7 +986,7 @@ + return cnt; + } + +-static int mem_resize(jas_stream_memobj_t *m, int bufsize) ++static int mem_resize(jas_stream_memobj_t *m, size_t bufsize) + { + unsigned char *buf; + Index: head/graphics/jasper/files/patch-jas_stream.h =================================================================== --- head/graphics/jasper/files/patch-jas_stream.h (nonexistent) +++ head/graphics/jasper/files/patch-jas_stream.h (revision 395527) @@ -0,0 +1,38 @@ +--- src/libjasper/include/jasper/jas_stream.h.orig 2007-01-19 22:43:04.000000000 +0100 ++++ src/libjasper/include/jasper/jas_stream.h 2015-08-29 07:54:41.000000000 +0200 +@@ -215,7 +215,7 @@ + uchar *bufstart_; + + /* The buffer size. */ +- int bufsize_; ++ size_t bufsize_; + + /* The current position in the buffer. */ + uchar *ptr_; +@@ -267,7 +267,7 @@ + uchar *buf_; + + /* The allocated size of the buffer for holding file data. */ +- int bufsize_; ++ size_t bufsize_; + + /* The length of the file. */ + int_fast32_t len_; +@@ -291,7 +291,7 @@ + jas_stream_t *jas_stream_fopen(const char *filename, const char *mode); + + /* Open a memory buffer as a stream. */ +-jas_stream_t *jas_stream_memopen(char *buf, int bufsize); ++jas_stream_t *jas_stream_memopen(char *buf, size_t bufsize); + + /* Open a file descriptor as a stream. */ + jas_stream_t *jas_stream_fdopen(int fd, const char *mode); +@@ -366,7 +366,7 @@ + int jas_stream_puts(jas_stream_t *stream, const char *s); + + /* Read a line of input from a stream. */ +-char *jas_stream_gets(jas_stream_t *stream, char *buf, int bufsize); ++char *jas_stream_gets(jas_stream_t *stream, char *buf, size_t bufsize); + + /* Look at the next character to be read from a stream without actually + removing it from the stream. */ Property changes on: head/graphics/jasper/files/patch-jas_stream.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/jasper/files/patch-jas_types.h =================================================================== --- head/graphics/jasper/files/patch-jas_types.h (revision 395526) +++ head/graphics/jasper/files/patch-jas_types.h (revision 395527) @@ -1,20 +1,18 @@ -$FreeBSD: /tmp/pcvs/ports/graphics/jasper/files/patch-jas_types.h,v 1.1 2009-07-05 09:50:02 dinoex Exp $ - --- src/libjasper/include/jasper/jas_types.h Sat Oct 4 12:57:58 2003 +++ src/libjasper/include/jasper/jas_types.h Wed Dec 17 10:29:46 2003 @@ -223,13 +223,13 @@ #endif /**********/ #if !defined(INT_FAST64_MIN) -typedef longlong int_fast64_t; +typedef long long int_fast64_t; #define INT_FAST64_MIN LLONG_MIN #define INT_FAST64_MAX LLONG_MAX #endif /**********/ #if !defined(UINT_FAST64_MAX) -typedef ulonglong uint_fast64_t; +typedef unsigned long long uint_fast64_t; #define UINT_FAST64_MAX ULLONG_MAX #endif /**********/ Index: head/graphics/jasper/files/patch-jpc_qmfb.c =================================================================== --- head/graphics/jasper/files/patch-jpc_qmfb.c (revision 395526) +++ head/graphics/jasper/files/patch-jpc_qmfb.c (revision 395527) @@ -1,74 +1,146 @@ --- src/libjasper/jpc/jpc_qmfb.c.orig 2007-01-19 22:43:07.000000000 +0100 -+++ src/libjasper/jpc/jpc_qmfb.c 2013-04-17 22:32:23.000000000 +0200 ++++ src/libjasper/jpc/jpc_qmfb.c 2015-08-29 08:07:01.000000000 +0200 +@@ -305,7 +305,7 @@ + void jpc_qmfb_split_row(jpc_fix_t *a, int numcols, int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numcols, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numcols, 1); + #if !defined(HAVE_VLA) + jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE]; + #else @@ -321,7 +321,7 @@ #if !defined(HAVE_VLA) /* Get a buffer. */ if (bufsize > QMFB_SPLITBUFSIZE) { - if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide in this case. */ abort(); } +@@ -373,7 +373,7 @@ + int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numrows, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numrows, 1); + #if !defined(HAVE_VLA) + jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE]; + #else @@ -389,7 +389,7 @@ #if !defined(HAVE_VLA) /* Get a buffer. */ if (bufsize > QMFB_SPLITBUFSIZE) { - if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide in this case. */ abort(); } +@@ -441,7 +441,7 @@ + int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numrows, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numrows, 1); + #if !defined(HAVE_VLA) + jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE]; + #else @@ -460,7 +460,7 @@ #if !defined(HAVE_VLA) /* Get a buffer. */ if (bufsize > QMFB_SPLITBUFSIZE) { - if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide in this case. */ abort(); } +@@ -530,7 +530,7 @@ + int stride, int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numrows, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numrows, 1); + #if !defined(HAVE_VLA) + jpc_fix_t splitbuf[QMFB_SPLITBUFSIZE * JPC_QMFB_COLGRPSIZE]; + #else @@ -549,7 +549,7 @@ #if !defined(HAVE_VLA) /* Get a buffer. */ if (bufsize > QMFB_SPLITBUFSIZE) { - if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide in this case. */ abort(); } +@@ -618,7 +618,7 @@ + void jpc_qmfb_join_row(jpc_fix_t *a, int numcols, int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numcols, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numcols, 1); + #if !defined(HAVE_VLA) + jpc_fix_t joinbuf[QMFB_JOINBUFSIZE]; + #else @@ -633,7 +633,7 @@ #if !defined(HAVE_VLA) /* Allocate memory for the join buffer from the heap. */ if (bufsize > QMFB_JOINBUFSIZE) { - if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide. */ abort(); } +@@ -683,7 +683,7 @@ + int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numrows, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numrows, 1); + #if !defined(HAVE_VLA) + jpc_fix_t joinbuf[QMFB_JOINBUFSIZE]; + #else @@ -698,7 +698,7 @@ #if !defined(HAVE_VLA) /* Allocate memory for the join buffer from the heap. */ if (bufsize > QMFB_JOINBUFSIZE) { - if (!(buf = jas_malloc(bufsize * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide. */ abort(); } +@@ -748,7 +748,7 @@ + int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numrows, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numrows, 1); + #if !defined(HAVE_VLA) + jpc_fix_t joinbuf[QMFB_JOINBUFSIZE * JPC_QMFB_COLGRPSIZE]; + #else @@ -766,7 +766,7 @@ #if !defined(HAVE_VLA) /* Allocate memory for the join buffer from the heap. */ if (bufsize > QMFB_JOINBUFSIZE) { - if (!(buf = jas_malloc(bufsize * JPC_QMFB_COLGRPSIZE * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, JPC_QMFB_COLGRPSIZE * sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide. */ abort(); } +@@ -834,7 +834,7 @@ + int stride, int parity) + { + +- int bufsize = JPC_CEILDIVPOW2(numrows, 1); ++ size_t bufsize = JPC_CEILDIVPOW2(numrows, 1); + #if !defined(HAVE_VLA) + jpc_fix_t joinbuf[QMFB_JOINBUFSIZE * JPC_QMFB_COLGRPSIZE]; + #else @@ -852,7 +852,7 @@ #if !defined(HAVE_VLA) /* Allocate memory for the join buffer from the heap. */ if (bufsize > QMFB_JOINBUFSIZE) { - if (!(buf = jas_malloc(bufsize * numcols * sizeof(jpc_fix_t)))) { + if (!(buf = jas_malloc2(bufsize, numcols, sizeof(jpc_fix_t)))) { /* We have no choice but to commit suicide. */ abort(); } Index: head/graphics/jasper/files/patch-mif_cod.c =================================================================== --- head/graphics/jasper/files/patch-mif_cod.c (revision 395526) +++ head/graphics/jasper/files/patch-mif_cod.c (revision 395527) @@ -1,12 +1,30 @@ --- src/libjasper/mif/mif_cod.c.orig 2007-01-19 22:43:05.000000000 +0100 -+++ src/libjasper/mif/mif_cod.c 2013-04-17 22:32:23.000000000 +0200 ++++ src/libjasper/mif/mif_cod.c 2015-08-29 08:07:01.000000000 +0200 +@@ -107,7 +107,7 @@ + static int mif_hdr_addcmpt(mif_hdr_t *hdr, int cmptno, mif_cmpt_t *cmpt); + static mif_cmpt_t *mif_cmpt_create(void); + static void mif_cmpt_destroy(mif_cmpt_t *cmpt); +-static char *mif_getline(jas_stream_t *jas_stream, char *buf, int bufsize); ++static char *mif_getline(jas_stream_t *jas_stream, char *buf, size_t bufsize); + static int mif_getc(jas_stream_t *in); + static mif_hdr_t *mif_makehdrfromimage(jas_image_t *image); + @@ -438,8 +438,7 @@ int cmptno; mif_cmpt_t **newcmpts; assert(maxcmpts >= hdr->numcmpts); - newcmpts = (!hdr->cmpts) ? jas_malloc(maxcmpts * sizeof(mif_cmpt_t *)) : - jas_realloc(hdr->cmpts, maxcmpts * sizeof(mif_cmpt_t *)); + newcmpts = jas_realloc2(hdr->cmpts, maxcmpts, sizeof(mif_cmpt_t *)); if (!newcmpts) { return -1; } +@@ -658,7 +657,7 @@ + * MIF parsing code. + \******************************************************************************/ + +-static char *mif_getline(jas_stream_t *stream, char *buf, int bufsize) ++static char *mif_getline(jas_stream_t *stream, char *buf, size_t bufsize) + { + int c; + char *bufptr;