Index: head/graphics/openjpeg/files/patch-src_lib_openjp2_pi.c =================================================================== --- head/graphics/openjpeg/files/patch-src_lib_openjp2_pi.c (revision 425063) +++ head/graphics/openjpeg/files/patch-src_lib_openjp2_pi.c (nonexistent) @@ -1,17 +0,0 @@ ---- src/lib/openjp2/pi.c.orig 2016-09-14 00:01:22 UTC -+++ src/lib/openjp2/pi.c -@@ -1236,7 +1236,13 @@ opj_pi_iterator_t *opj_pi_create_decode( - l_current_pi = l_pi; - - /* memory allocation for include */ -- l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); -+ /* prevent an integer overflow issue */ -+ l_current_pi->include = 00; -+ if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U))) -+ { -+ l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16)); -+ } -+ - if - (!l_current_pi->include) - { Property changes on: head/graphics/openjpeg/files/patch-src_lib_openjp2_pi.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/openjpeg/files/patch-src_lib_openjp2_tcd.c =================================================================== --- head/graphics/openjpeg/files/patch-src_lib_openjp2_tcd.c (revision 425063) +++ head/graphics/openjpeg/files/patch-src_lib_openjp2_tcd.c (nonexistent) @@ -1,23 +0,0 @@ ---- src/lib/openjp2/tcd.c.orig 2016-09-14 00:02:27 UTC -+++ src/lib/openjp2/tcd.c -@@ -706,9 +706,20 @@ static INLINE OPJ_BOOL opj_tcd_init_tile - l_tx0 = l_cp->tx0 + p * l_cp->tdx; /* can't be greater than l_image->x1 so won't overflow */ - l_tile->x0 = (OPJ_INT32)opj_uint_max(l_tx0, l_image->x0); - l_tile->x1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_tx0, l_cp->tdx), l_image->x1); -+ /* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */ -+ if ((l_tile->x0 < 0) || (l_tile->x1 <= l_tile->x0)) { -+ opj_event_msg(manager, EVT_ERROR, "Tile X coordinates are not supported\n"); -+ return OPJ_FALSE; -+ } - l_ty0 = l_cp->ty0 + q * l_cp->tdy; /* can't be greater than l_image->y1 so won't overflow */ - l_tile->y0 = (OPJ_INT32)opj_uint_max(l_ty0, l_image->y0); - l_tile->y1 = (OPJ_INT32)opj_uint_min(opj_uint_adds(l_ty0, l_cp->tdy), l_image->y1); -+ /* all those OPJ_UINT32 are casted to OPJ_INT32, let's do some sanity check */ -+ if ((l_tile->y0 < 0) || (l_tile->y1 <= l_tile->y0)) { -+ opj_event_msg(manager, EVT_ERROR, "Tile Y coordinates are not supported\n"); -+ return OPJ_FALSE; -+ } -+ - - /* testcase 1888.pdf.asan.35.988 */ - if (l_tccp->numresolutions == 0) { Property changes on: head/graphics/openjpeg/files/patch-src_lib_openjp2_tcd.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/openjpeg/files/patch-tests_compare__dump__files.c =================================================================== --- head/graphics/openjpeg/files/patch-tests_compare__dump__files.c (revision 425063) +++ head/graphics/openjpeg/files/patch-tests_compare__dump__files.c (nonexistent) @@ -1,30 +0,0 @@ ---- tests/compare_dump_files.c.orig 2016-09-14 00:05:13 UTC -+++ tests/compare_dump_files.c -@@ -118,10 +118,10 @@ int main(int argc, char **argv) - test_cmp_parameters inParam; - FILE *fbase=NULL, *ftest=NULL; - int same = 0; -- char lbase[256]; -- char strbase[256]; -- char ltest[256]; -- char strtest[256]; -+ char lbase[512]; -+ char strbase[512]; -+ char ltest[512]; -+ char strtest[512]; - - if( parse_cmdline_cmp(argc, argv, &inParam) == 1 ) - { -@@ -154,9 +154,9 @@ int main(int argc, char **argv) - - while (fgets(lbase, sizeof(lbase), fbase) && fgets(ltest,sizeof(ltest),ftest)) - { -- int nbase = sscanf(lbase, "%255[^\r\n]", strbase); -- int ntest = sscanf(ltest, "%255[^\r\n]", strtest); -- assert( nbase != 255 && ntest != 255 ); -+ int nbase = sscanf(lbase, "%511[^\r\n]", strbase); -+ int ntest = sscanf(ltest, "%511[^\r\n]", strtest); -+ assert( nbase != 511 && ntest != 511 ); - if( nbase != 1 || ntest != 1 ) - { - fprintf(stderr, "could not parse line from files\n" ); Property changes on: head/graphics/openjpeg/files/patch-tests_compare__dump__files.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/openjpeg/files/patch-src-lib-openjp2-j2k.c =================================================================== --- head/graphics/openjpeg/files/patch-src-lib-openjp2-j2k.c (revision 425063) +++ head/graphics/openjpeg/files/patch-src-lib-openjp2-j2k.c (nonexistent) @@ -1,59 +0,0 @@ -Obtained from: https://github.com/uclouvain/openjpeg/commit/a4e93c3b0af1c42770206b5d25014a05a60ec8f5 - https://github.com/uclouvain/openjpeg/commit/c16c91797f4b15eb55d56f85fd497d588331e71f - https://github.com/uclouvain/openjpeg/commit/55dbf8acff9afab1591b6a094b744d8426a32dd4 - ---- src/lib/openjp2/j2k.c.orig 2015-09-16 18:49:45 UTC -+++ src/lib/openjp2/j2k.c -@@ -8603,8 +8603,10 @@ static opj_codestream_index_t* opj_j2k_c - cstr_index->marknum = 0; - cstr_index->marker = (opj_marker_info_t*) - opj_calloc(cstr_index->maxmarknum, sizeof(opj_marker_info_t)); -- if (!cstr_index-> marker) -+ if (!cstr_index-> marker) { -+ opj_free(cstr_index); - return NULL; -+ } - - cstr_index->tile_index = NULL; - -@@ -9668,14 +9670,14 @@ static OPJ_BOOL opj_j2k_decode_one_tile - * so move to the last SOT read */ - if ( !(opj_stream_read_seek(p_stream, p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos+2, p_manager)) ){ - opj_event_msg(p_manager, EVT_ERROR, "Problem with seek function\n"); -- opj_free(l_current_data); -+ opj_free(l_current_data); - return OPJ_FALSE; - } - } - else{ - if ( !(opj_stream_read_seek(p_stream, p_j2k->cstr_index->tile_index[l_tile_no_to_dec].tp_index[0].start_pos+2, p_manager)) ) { - opj_event_msg(p_manager, EVT_ERROR, "Problem with seek function\n"); -- opj_free(l_current_data); -+ opj_free(l_current_data); - return OPJ_FALSE; - } - } -@@ -9733,6 +9735,7 @@ static OPJ_BOOL opj_j2k_decode_one_tile - /* move into the codestream to the the first SOT (FIXME or not move?)*/ - if (!(opj_stream_read_seek(p_stream, p_j2k->cstr_index->main_head_end + 2, p_manager) ) ) { - opj_event_msg(p_manager, EVT_ERROR, "Problem with seek function\n"); -+ opj_free(l_current_data); - return OPJ_FALSE; - } - break; -@@ -9998,11 +10001,15 @@ OPJ_BOOL opj_j2k_encode(opj_j2k_t * p_j2 - /* now copy this data into the tile component */ - if (! opj_tcd_copy_tile_data(p_j2k->m_tcd,l_current_data,l_current_tile_size)) { - opj_event_msg(p_manager, EVT_ERROR, "Size mismatch between tile data and sent data." ); -+ opj_free(l_current_data); - return OPJ_FALSE; - } - } - - if (! opj_j2k_post_write_tile (p_j2k,p_stream,p_manager)) { -+ if (l_current_data) { -+ opj_free(l_current_data); -+ } - return OPJ_FALSE; - } - } Property changes on: head/graphics/openjpeg/files/patch-src-lib-openjp2-j2k.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/openjpeg/files/patch-tests_nonregression_test__suite.ctest.in =================================================================== --- head/graphics/openjpeg/files/patch-tests_nonregression_test__suite.ctest.in (revision 425063) +++ head/graphics/openjpeg/files/patch-tests_nonregression_test__suite.ctest.in (nonexistent) @@ -1,9 +0,0 @@ ---- tests/nonregression/test_suite.ctest.in.orig 2016-09-14 00:06:50 UTC -+++ tests/nonregression/test_suite.ctest.in -@@ -505,3 +505,6 @@ opj_decompress -i @INPUT_NR_PATH@/issue2 - # issue 326 + PR 559: CIELab colorspace - opj_decompress -i @INPUT_NR_PATH@/issue559-eci-090-CIELab.jp2 -o @TEMP_PATH@/issue559-eci-090-CIELab.jp2.pgx - opj_decompress -i @INPUT_NR_PATH@/issue559-eci-091-CIELab.jp2 -o @TEMP_PATH@/issue559-eci-091-CIELab.jp2.pgx -+# issue 823 (yes, not a typo, test image is issue822) -+!opj_decompress -i @INPUT_NR_PATH@/issue822.jp2 -o @TEMP_PATH@/issue822.png -+ Property changes on: head/graphics/openjpeg/files/patch-tests_nonregression_test__suite.ctest.in ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/openjpeg/Makefile =================================================================== --- head/graphics/openjpeg/Makefile (revision 425063) +++ head/graphics/openjpeg/Makefile (revision 425064) @@ -1,33 +1,32 @@ # Created by: trasz # $FreeBSD$ PORTNAME= openjpeg -PORTVERSION= 2.1.1 +PORTVERSION= 2.1.2 +DISTVERSIONPREFIX= v PORTREVISION= 1 CATEGORIES= graphics MAINTAINER= sunpoet@FreeBSD.org COMMENT= Open-source JPEG 2000 codec LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= cmake>=3:devel/cmake LIB_DEPENDS= liblcms2.so:graphics/lcms2 \ libpng.so:graphics/png \ libtiff.so:graphics/tiff USE_LDCONFIG= yes USES= cmake cpe pkgconfig PLIST_SUB= VER=${PORTVERSION:R} GH_ACCOUNT= uclouvain -#GH_TAGNAME= version.${PORTVERSION:R} -GH_TAGNAME= 9c911c0 USE_GITHUB= yes post-patch: @${REINPLACE_CMD} -e 's|$${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig|libdata/pkgconfig|' ${WRKSRC}/CMakeLists.txt .include Index: head/graphics/openjpeg/distinfo =================================================================== --- head/graphics/openjpeg/distinfo (revision 425063) +++ head/graphics/openjpeg/distinfo (revision 425064) @@ -1,2 +1,3 @@ -SHA256 (uclouvain-openjpeg-2.1.1-9c911c0_GH0.tar.gz) = cb0f08de689cfc70604876aaa68c11546db508d0d711e48d946bd2b0a154f50d -SIZE (uclouvain-openjpeg-2.1.1-9c911c0_GH0.tar.gz) = 1942736 +TIMESTAMP = 1475154150 +SHA256 (uclouvain-openjpeg-v2.1.2_GH0.tar.gz) = 4ce77b6ef538ef090d9bde1d5eeff8b3069ab56c4906f083475517c2c023dfa7 +SIZE (uclouvain-openjpeg-v2.1.2_GH0.tar.gz) = 1987071 Index: head/graphics/openjpeg/pkg-plist =================================================================== --- head/graphics/openjpeg/pkg-plist (revision 425063) +++ head/graphics/openjpeg/pkg-plist (revision 425064) @@ -1,13 +1,13 @@ bin/opj_compress bin/opj_decompress bin/opj_dump include/openjpeg-%%VER%%/openjpeg.h include/openjpeg-%%VER%%/opj_config.h include/openjpeg-%%VER%%/opj_stdint.h lib/libopenjp2.so -lib/libopenjp2.so.%%VER%%.0 +lib/libopenjp2.so.%%VER%%.2 lib/libopenjp2.so.7 lib/openjpeg-%%VER%%/OpenJPEGConfig.cmake lib/openjpeg-%%VER%%/OpenJPEGTargets-%%CMAKE_BUILD_TYPE%%.cmake lib/openjpeg-%%VER%%/OpenJPEGTargets.cmake libdata/pkgconfig/libopenjp2.pc