GraphicsMagick: jp2/* Update jasper library to 1.900.3.
GraphicsMagick Commits <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.cvs |
|---|---|
| Message-ID | <mailman.35668.1671753294.1567.graphicsmagick-commit@lists.sourceforge.net> |
changeset fada78baed32 in /hg/GraphicsMagick details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=fada78baed32 summary: jp2/* Update jasper library to 1.900.3. diffstat: jp2/ChangeLog | 69 +++++++++++++++++++++- jp2/configure | 24 +++--- jp2/configure.ac | 2 +- jp2/jasper.spec | 4 +- jp2/src/libjasper/base/jas_icc.c | 59 +++++++++++++---- jp2/src/libjasper/base/jas_image.c | 8 ++ jp2/src/libjasper/base/jas_seq.c | 87 +++++++++++++++----------- jp2/src/libjasper/include/jasper/jas_config.h | 10 +- jp2/src/libjasper/jp2/jp2_cod.c | 2 - jp2/src/libjasper/jp2/jp2_dec.c | 5 +- jp2/src/libjasper/jp2/jp2_enc.c | 1 - jp2/src/libjasper/jpc/jpc_t1cod.c | 10 +- 12 files changed, 200 insertions(+), 81 deletions(-) diffs (truncated from 599 to 500 lines): diff -r c960d477342d -r fada78baed32 jp2/ChangeLog --- a/jp2/ChangeLog Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/ChangeLog Fri Dec 23 00:57:51 2022 +0100 @@ -1,6 +1,64 @@ +commit 779ddf80c2a9021d5ed134319c54bc38ca9ef9b6 +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 12:40:22 2016 -0700 + + Bump the version number. + +M configure.ac + +commit 4bb93a6c49da7c1b6ad2acb60b18954a6547c637 +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 12:31:54 2016 -0700 + + Add fixes for CVE-2014-8137. + +M src/libjasper/base/jas_icc.c +M src/libjasper/jp2/jp2_dec.c + +commit c87ad330a8b8d6e5eb0065675601fdfae08ebaab +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 11:37:33 2016 -0700 + + Added fix for CVE-2016-2089. + +M src/libjasper/base/jas_image.c +M src/libjasper/base/jas_seq.c + +commit 1184d7e6e604d2340dac7b91077d0faee05579ec +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 07:59:22 2016 -0700 + + Moved abort into default case of switch statement. + +M src/libjasper/jpc/jpc_t1cod.c + +commit 7266072ad79a8555dfd619e7bbe8a3f1d0b58ee9 +Merge: 3ffc4e0 fadd6c4 +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 07:52:27 2016 -0700 + + Merge branch 'hughsie-wip/hughsie/Coverity-UNREACHABLE' + +commit fadd6c45c6941a222c692eff7df71a6dfaa08fec +Merge: 3ffc4e0 ac401b7 +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 07:48:44 2016 -0700 + + Merge branch 'wip/hughsie/Coverity-UNREACHABLE' + of https://github.com/hughsie/jasper into + hughsie-wip/hughsie/Coverity-UNREACHABLE + +commit 3ffc4e09007e1a830828eb994c11c3b8c8237249 +Author: Michael Adams <[email protected]> +Date: Wed Oct 12 00:09:33 2016 -0700 + + Remove auto-generated file aclocal.m4 from repository. + +D aclocal.m4 + commit 063ab4e30d9dff0b1142ca659f4af14ee1ec4296 Author: Michael Adams <[email protected]> -Date: Tue Oct 4 20:19:58 2016 -0700 +Date: Tue Oct 4 20:19:58 2016 -0700 Bump the version number @@ -392,6 +450,15 @@ A pkgconfig/Makefile.am A pkgconfig/jasper.pc.in +commit ac401b7bae573b66aa9d366c9a0b46750a2534a7 +Author: Richard Hughes <[email protected]> +Date: Mon Sep 19 10:03:36 2016 +0100 + + Coverity-UNREACHABLE + +M src/libjasper/jp2/jp2_cod.c +M src/libjasper/jp2/jp2_enc.c + commit 980da43d8d388a67cac505e734423b2a5aa4cede Author: Richard Hughes <[email protected]> Date: Mon Sep 19 10:03:36 2016 +0100 diff -r c960d477342d -r fada78baed32 jp2/configure --- a/jp2/configure Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/configure Fri Dec 23 00:57:51 2022 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for jasper 1.900.2. +# Generated by GNU Autoconf 2.69 for jasper 1.900.3. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -587,8 +587,8 @@ # Identity of this package. PACKAGE_NAME='jasper' PACKAGE_TARNAME='jasper' -PACKAGE_VERSION='1.900.2' -PACKAGE_STRING='jasper 1.900.2' +PACKAGE_VERSION='1.900.3' +PACKAGE_STRING='jasper 1.900.3' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1341,7 +1341,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures jasper 1.900.2 to adapt to many kinds of systems. +\`configure' configures jasper 1.900.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1416,7 +1416,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of jasper 1.900.2:";; + short | recursive ) echo "Configuration of jasper 1.900.3:";; esac cat <<\_ACEOF @@ -1530,7 +1530,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -jasper configure 1.900.2 +jasper configure 1.900.3 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1949,7 +1949,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by jasper $as_me 1.900.2, which was +It was created by jasper $as_me 1.900.3, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -11507,7 +11507,7 @@ # Define the identity of the package. PACKAGE='jasper' - VERSION='1.900.2' + VERSION='1.900.3' cat >>confdefs.h <<_ACEOF @@ -11731,8 +11731,8 @@ # Initialize version information parameters. JAS_MAJOR_VERSION=1 JAS_MINOR_VERSION=900 -JAS_MICRO_VERSION=2 -JAS_VERSION=1.900.2 +JAS_MICRO_VERSION=3 +JAS_VERSION=1.900.3 @@ -14376,7 +14376,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by jasper $as_me 1.900.2, which was +This file was extended by jasper $as_me 1.900.3, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14442,7 +14442,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -jasper config.status 1.900.2 +jasper config.status 1.900.3 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -r c960d477342d -r fada78baed32 jp2/configure.ac --- a/jp2/configure.ac Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/configure.ac Fri Dec 23 00:57:51 2022 +0100 @@ -16,7 +16,7 @@ dnl The major, minor, and micro version numbers of the package. define(AC_JAS_MAJOR_VERSION, 1) define(AC_JAS_MINOR_VERSION, 900) -define(AC_JAS_MICRO_VERSION, 2) +define(AC_JAS_MICRO_VERSION, 3) dnl The package version. define(AC_JAS_VERSION, diff -r c960d477342d -r fada78baed32 jp2/jasper.spec --- a/jp2/jasper.spec Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/jasper.spec Fri Dec 23 00:57:51 2022 +0100 @@ -1,6 +1,6 @@ # Note that this is NOT a relocatable package %define package_name jasper -%define ver 1.900.2 +%define ver 1.900.3 %define prefix /usr %define datadir %{prefix}/share %define release 1 @@ -13,7 +13,7 @@ Group: Development/Libraries # FIXME: -Source: http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-1.900.2.tar.gz +Source: http://www.ece.uvic.ca/~mdadams/jasper/software/jasper-1.900.3.tar.gz BuildRoot: /var/tmp/%{package_name}-%{version}-root Requires: libjpeg diff -r c960d477342d -r fada78baed32 jp2/src/libjasper/base/jas_icc.c --- a/jp2/src/libjasper/base/jas_icc.c Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/src/libjasper/base/jas_icc.c Fri Dec 23 00:57:51 2022 +0100 @@ -972,8 +972,10 @@ static void jas_icccurv_destroy(jas_iccattrval_t *attrval) { jas_icccurv_t *curv = &attrval->data.curv; - if (curv->ents) + if (curv->ents) { jas_free(curv->ents); + curv->ents = 0; + } } static int jas_icccurv_copy(jas_iccattrval_t *attrval, @@ -1060,10 +1062,14 @@ static void jas_icctxtdesc_destroy(jas_iccattrval_t *attrval) { jas_icctxtdesc_t *txtdesc = &attrval->data.txtdesc; - if (txtdesc->ascdata) + if (txtdesc->ascdata) { jas_free(txtdesc->ascdata); - if (txtdesc->ucdata) + txtdesc->ascdata = 0; + } + if (txtdesc->ucdata) { jas_free(txtdesc->ucdata); + txtdesc->ucdata = 0; + } } static int jas_icctxtdesc_copy(jas_iccattrval_t *attrval, @@ -1180,8 +1186,10 @@ static void jas_icctxt_destroy(jas_iccattrval_t *attrval) { jas_icctxt_t *txt = &attrval->data.txt; - if (txt->string) + if (txt->string) { jas_free(txt->string); + txt->string = 0; + } } static int jas_icctxt_copy(jas_iccattrval_t *attrval, @@ -1208,8 +1216,7 @@ goto error; return 0; error: - if (txt->string) - jas_free(txt->string); + jas_icctxt_destroy(attrval); return -1; } @@ -1241,16 +1248,26 @@ static void jas_icclut8_destroy(jas_iccattrval_t *attrval) { jas_icclut8_t *lut8 = &attrval->data.lut8; - if (lut8->clut) + if (lut8->clut) { jas_free(lut8->clut); - if (lut8->intabs) + lut8->clut = 0; + } + if (lut8->intabs) { jas_free(lut8->intabs); - if (lut8->intabsbuf) + lut8->intabs = 0; + } + if (lut8->intabsbuf) { jas_free(lut8->intabsbuf); - if (lut8->outtabs) + lut8->intabsbuf = 0; + } + if (lut8->outtabs) { jas_free(lut8->outtabs); - if (lut8->outtabsbuf) + lut8->outtabs = 0; + } + if (lut8->outtabsbuf) { jas_free(lut8->outtabsbuf); + lut8->outtabsbuf = 0; + } } static int jas_icclut8_copy(jas_iccattrval_t *attrval, @@ -1411,16 +1428,26 @@ static void jas_icclut16_destroy(jas_iccattrval_t *attrval) { jas_icclut16_t *lut16 = &attrval->data.lut16; - if (lut16->clut) + if (lut16->clut) { jas_free(lut16->clut); - if (lut16->intabs) + lut16->clut = 0; + } + if (lut16->intabs) { jas_free(lut16->intabs); - if (lut16->intabsbuf) + lut16->intabs = 0; + } + if (lut16->intabsbuf) { jas_free(lut16->intabsbuf); - if (lut16->outtabs) + lut16->intabsbuf = 0; + } + if (lut16->outtabs) { jas_free(lut16->outtabs); - if (lut16->outtabsbuf) + lut16->outtabs = 0; + } + if (lut16->outtabsbuf) { jas_free(lut16->outtabsbuf); + lut16->outtabsbuf = 0; + } } static int jas_icclut16_copy(jas_iccattrval_t *attrval, diff -r c960d477342d -r fada78baed32 jp2/src/libjasper/base/jas_image.c --- a/jp2/src/libjasper/base/jas_image.c Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/src/libjasper/base/jas_image.c Fri Dec 23 00:57:51 2022 +0100 @@ -426,6 +426,10 @@ return -1; } + if (!jas_matrix_numrows(data) || !jas_matrix_numcols(data)) { + return -1; + } + if (jas_matrix_numrows(data) != height || jas_matrix_numcols(data) != width) { if (jas_matrix_resize(data, height, width)) { return -1; @@ -479,6 +483,10 @@ return -1; } + if (!jas_matrix_numrows(data) || !jas_matrix_numcols(data)) { + return -1; + } + if (jas_matrix_numrows(data) != height || jas_matrix_numcols(data) != width) { return -1; } diff -r c960d477342d -r fada78baed32 jp2/src/libjasper/base/jas_seq.c --- a/jp2/src/libjasper/base/jas_seq.c Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/src/libjasper/base/jas_seq.c Fri Dec 23 00:57:51 2022 +0100 @@ -262,13 +262,16 @@ int rowstep; jas_seqent_t *data; - rowstep = jas_matrix_rowstep(matrix); - for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, - rowstart += rowstep) { - for (j = matrix->numcols_, data = rowstart; j > 0; --j, - ++data) { - *data = (*data >= 0) ? ((*data) >> n) : - (-((-(*data)) >> n)); + if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { + assert(matrix->rows_); + rowstep = jas_matrix_rowstep(matrix); + for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, + rowstart += rowstep) { + for (j = matrix->numcols_, data = rowstart; j > 0; --j, + ++data) { + *data = (*data >= 0) ? ((*data) >> n) : + (-((-(*data)) >> n)); + } } } } @@ -282,17 +285,20 @@ jas_seqent_t *data; int rowstep; - rowstep = jas_matrix_rowstep(matrix); - for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, - rowstart += rowstep) { - data = rowstart; - for (j = matrix->numcols_, data = rowstart; j > 0; --j, - ++data) { - v = *data; - if (v < minval) { - *data = minval; - } else if (v > maxval) { - *data = maxval; + if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { + assert(matrix->rows_); + rowstep = jas_matrix_rowstep(matrix); + for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, + rowstart += rowstep) { + data = rowstart; + for (j = matrix->numcols_, data = rowstart; j > 0; --j, + ++data) { + v = *data; + if (v < minval) { + *data = minval; + } else if (v > maxval) { + *data = maxval; + } } } } @@ -307,12 +313,15 @@ jas_seqent_t *data; assert(n >= 0); - rowstep = jas_matrix_rowstep(matrix); - for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, - rowstart += rowstep) { - for (j = matrix->numcols_, data = rowstart; j > 0; --j, - ++data) { - *data >>= n; + if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { + assert(matrix->rows_); + rowstep = jas_matrix_rowstep(matrix); + for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, + rowstart += rowstep) { + for (j = matrix->numcols_, data = rowstart; j > 0; --j, + ++data) { + *data >>= n; + } } } } @@ -325,12 +334,15 @@ int rowstep; jas_seqent_t *data; - rowstep = jas_matrix_rowstep(matrix); - for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, - rowstart += rowstep) { - for (j = matrix->numcols_, data = rowstart; j > 0; --j, - ++data) { - *data <<= n; + if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { + assert(matrix->rows_); + rowstep = jas_matrix_rowstep(matrix); + for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, + rowstart += rowstep) { + for (j = matrix->numcols_, data = rowstart; j > 0; --j, + ++data) { + *data <<= n; + } } } } @@ -367,12 +379,15 @@ int rowstep; jas_seqent_t *data; - rowstep = jas_matrix_rowstep(matrix); - for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, - rowstart += rowstep) { - for (j = matrix->numcols_, data = rowstart; j > 0; --j, - ++data) { - *data = val; + if (jas_matrix_numrows(matrix) > 0 && jas_matrix_numcols(matrix) > 0) { + assert(matrix->rows_); + rowstep = jas_matrix_rowstep(matrix); + for (i = matrix->numrows_, rowstart = matrix->rows_[0]; i > 0; --i, + rowstart += rowstep) { + for (j = matrix->numcols_, data = rowstart; j > 0; --j, + ++data) { + *data = val; + } } } } diff -r c960d477342d -r fada78baed32 jp2/src/libjasper/include/jasper/jas_config.h --- a/jp2/src/libjasper/include/jasper/jas_config.h Thu Dec 22 01:59:44 2022 +0100 +++ b/jp2/src/libjasper/include/jasper/jas_config.h Fri Dec 23 00:57:51 2022 +0100 @@ -7,7 +7,7 @@ #define JAS_CONFIG_H /* This preprocessor symbol identifies the version of JasPer. */ -#define JAS_VERSION "1.900.2" +#define JAS_VERSION "1.900.3" /* If configure is being used, this symbol will be defined automatically at this point in the configuration header file. */ @@ -110,7 +110,7 @@ #define JAS_CONFIGURE 1 /* JasPer version */ -#define JAS_VERSION "1.900.2" +#define JAS_VERSION "1.900.3"