From b8b78b9917ede066d5e33c6a9f52cc72ec591a4f Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sat, 28 Sep 2019 19:28:25 +0000 Subject: Release 10.86.06 git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@3688 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- GNUmakefile | 8 ++++---- .../other/jpeg2000/libjasper/base/jas_image.c | 4 ++++ converter/other/jpeg2000/libjasper/jp2/jp2_dec.c | 3 +++ converter/other/jpeg2000/libjasper/jpc/jpc_dec.c | 23 +++++++++++++++++++++- converter/other/jpeg2000/libjasper/jpc/jpc_math.c | 4 ++-- converter/other/jpeg2000/libjasper/jpc/jpc_math.h | 7 ++++--- doc/HISTORY | 16 +++++++++++++++ version.mk | 2 +- 8 files changed, 56 insertions(+), 11 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 1beebb4c..e5b0265a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -108,7 +108,7 @@ nonmerge: $(PRODUCT_SUBDIRS:%=%/all) # simultaneously find that pm_config.h needs to be built and proceed to build # it. After one thread has built pm_config.h, it will proceed to use # pm_config.h, but the other thread is still building pm_config.h, which is -# not valid while it is in the middle of being built. +# not valid while it is in the middle of being used. # # But many submakes don't have any such shared dependencies, so build their # targets in parallel just fine. So we declare this make file ineligible for @@ -149,7 +149,7 @@ $(TYPEGEN) $(ENDIANGEN): $(BUILDDIR)/buildtools $(MAKE) -C $(dir $@) -f $(SRCDIR)/buildtools/Makefile \ SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) $(notdir $@) -$(BUILDDIR)/inttypes_netpbm.h: $(TYPEGEN) +inttypes_netpbm.h: $(TYPEGEN) $(TYPEGEN) >$@ @@ -165,7 +165,7 @@ $(TESTRANDOM): $(BUILDDIR)/test # that or to override the results, because it doesn't work if he's # cross compiling. -$(BUILDDIR)/pm_config.h: \ +pm_config.h: \ $(SRCDIR)/pm_config.in.h config.mk inttypes_netpbm.h \ $(ENDIANGEN) # Note that this rule depends on the effect of the .DELETE_ON_ERROR @@ -207,7 +207,7 @@ endif MAJOR := $(NETPBM_MAJOR_RELEASE) MINOR := $(NETPBM_MINOR_RELEASE) POINT := $(NETPBM_POINT_RELEASE) -$(BUILDDIR)/version.h: $(SRCDIR)/version.mk +version.h: $(SRCDIR)/version.mk @rm -f $@ @echo "/* Generated by make file rule */" >>$@ @echo "#define NETPBM_VERSION" \ diff --git a/converter/other/jpeg2000/libjasper/base/jas_image.c b/converter/other/jpeg2000/libjasper/base/jas_image.c index 903b45c6..5c2822be 100644 --- a/converter/other/jpeg2000/libjasper/base/jas_image.c +++ b/converter/other/jpeg2000/libjasper/base/jas_image.c @@ -885,6 +885,10 @@ int jas_image_depalettize(jas_image_t *image, int cmptno, int numlutents, cmptparms.prec = JAS_IMAGE_CDT_GETPREC(dtype); cmptparms.sgnd = JAS_IMAGE_CDT_GETSGND(dtype); + if (numlutents < 1) { + return -1; + } + if (jas_image_addcmpt(image, newcmptno, &cmptparms)) { return -1; } diff --git a/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c b/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c index a9463a57..4036f0f2 100644 --- a/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c +++ b/converter/other/jpeg2000/libjasper/jp2/jp2_dec.c @@ -563,6 +563,9 @@ jp2_decode(jas_stream_t *in, char *optstr) { channo + 1)); } #endif + } else { + jas_eprintf("error: invalid MTYP in CMAP box\n"); + goto error; } } } diff --git a/converter/other/jpeg2000/libjasper/jpc/jpc_dec.c b/converter/other/jpeg2000/libjasper/jpc/jpc_dec.c index cada97f8..4d4dfc50 100644 --- a/converter/other/jpeg2000/libjasper/jpc/jpc_dec.c +++ b/converter/other/jpeg2000/libjasper/jpc/jpc_dec.c @@ -597,7 +597,9 @@ static int jpc_dec_process_sod(jpc_dec_t *dec, jpc_ms_t *ms) if (!jpc_dec_cp_isvalid(tile->cp)) { return -1; } - jpc_dec_cp_prepare(tile->cp); + if (jpc_dec_cp_prepare(tile->cp)) { + return -1; + } if (jpc_dec_tileinit(dec, tile)) { return -1; } @@ -1249,6 +1251,15 @@ static int jpc_dec_process_siz(jpc_dec_t *dec, jpc_ms_t *ms) return -1; } + for (tileno = 0, tile = dec->tiles; + tileno < dec->numtiles; + ++tileno, ++tile) { + /* initialize all tiles with JPC_TILE_DONE so jpc_dec_destroy() knows + which ones need a jpc_dec_tilefini() call; they are not actually + "done", of course */ + tile->state = JPC_TILE_DONE; + } + for (tileno = 0, tile = dec->tiles; tileno < dec->numtiles; ++tileno, ++tile) { htileno = tileno % dec->numhtiles; @@ -1929,6 +1940,16 @@ static void jpc_dec_destroy(jpc_dec_t *dec) } if (dec->tiles) { + int tileno; + jpc_dec_tile_t *tile; + + for (tileno = 0, tile = dec->tiles; + tileno < dec->numtiles; + ++tileno, ++tile) { + if (tile->state != JPC_TILE_DONE) { + jpc_dec_tilefini(dec, tile); + } + } jas_free(dec->tiles); } diff --git a/converter/other/jpeg2000/libjasper/jpc/jpc_math.c b/converter/other/jpeg2000/libjasper/jpc/jpc_math.c index 72e3ac37..01e3611e 100644 --- a/converter/other/jpeg2000/libjasper/jpc/jpc_math.c +++ b/converter/other/jpeg2000/libjasper/jpc/jpc_math.c @@ -12,7 +12,7 @@ /* Calculate the integer quantity floor(log2(x)), where x is a positive integer. */ int -jpc_floorlog2(int const arg) { +jpc_floorlog2(int_fast32_t const arg) { int y; int x; @@ -46,7 +46,7 @@ jpc_firstone(n) :-1 0 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 int -jpc_firstone(int const arg) { +jpc_firstone(int_fast32_t const arg) { /*---------------------------------------------------------------------------- Calculate the bit position of the first leading one in a nonnegative integer. diff --git a/converter/other/jpeg2000/libjasper/jpc/jpc_math.h b/converter/other/jpeg2000/libjasper/jpc/jpc_math.h index 77df0c62..cd24c6a6 100644 --- a/converter/other/jpeg2000/libjasper/jpc/jpc_math.h +++ b/converter/other/jpeg2000/libjasper/jpc/jpc_math.h @@ -115,7 +115,8 @@ * Includes \******************************************************************************/ -#include +#include +#include /******************************************************************************\ * Macros @@ -146,10 +147,10 @@ /* Calculate the bit position of the first leading one in a nonnegative integer. */ -int jpc_firstone(int x); +int jpc_firstone(int_fast32_t x); /* Calculate the integer quantity floor(log2(x)), where x is a positive integer. */ -int jpc_floorlog2(int x); +int jpc_floorlog2(int_fast32_t x); #endif diff --git a/doc/HISTORY b/doc/HISTORY index 1d6d1359..3b5030e2 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -4,6 +4,22 @@ Netpbm. CHANGE HISTORY -------------- +19.09.28 BJH Release 10.86.06 + + jpeg2ktopam, pamtojpeg2k: fix negative array index. Always + broken (pamtojpeg2k was new in Netpbm 10.12 (November 2002)). + + jpeg2ktopam, pamtojpeg2k: fix assertion failure. Always + broken (pamtojpeg2k was new in Netpbm 10.12 (November 2002)). + + jpeg2ktopam: Fix memory leak after decoder failure. Always + broken (pamtojpeg2k was new in Netpbm 10.12 (November 2002)). + + jpeg2ktopam: fix null pointer dereference. Always broken + (pamtojpeg2k was new in Netpbm 10.12 (November 2002)). + + Build: fix for Cygwin, "no rule to make pm_config.h". + 19.08.09 BJH Release 10.86.05 pnmtorle, rletopnm: fix wild pointer dereference when a memory diff --git a/version.mk b/version.mk index e5fda1d2..5b941c50 100644 --- a/version.mk +++ b/version.mk @@ -1,3 +1,3 @@ NETPBM_MAJOR_RELEASE = 10 NETPBM_MINOR_RELEASE = 86 -NETPBM_POINT_RELEASE = 5 +NETPBM_POINT_RELEASE = 6 -- cgit 1.4.1