diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-08-29 20:53:19 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2019-08-29 20:53:19 +0000 |
commit | ad6f7da845c93eeb6634e8e2931a8c08440700bb (patch) | |
tree | 2ab6332693e0f6e39b46a1b6f49ab18edf1b983b | |
parent | 061042409d376b8d7d3aeadbd6d46c2f34bde9cb (diff) | |
download | netpbm-mirror-ad6f7da845c93eeb6634e8e2931a8c08440700bb.tar.gz netpbm-mirror-ad6f7da845c93eeb6634e8e2931a8c08440700bb.tar.xz netpbm-mirror-ad6f7da845c93eeb6634e8e2931a8c08440700bb.zip |
Fix assertion failure
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3669 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r-- | converter/other/jpeg2000/libjasper/jpc/jpc_dec.c | 4 | ||||
-rw-r--r-- | converter/other/jpeg2000/libjasper/jpc/jpc_math.c | 4 | ||||
-rw-r--r-- | converter/other/jpeg2000/libjasper/jpc/jpc_math.h | 7 | ||||
-rw-r--r-- | doc/HISTORY | 7 |
4 files changed, 14 insertions, 8 deletions
diff --git a/converter/other/jpeg2000/libjasper/jpc/jpc_dec.c b/converter/other/jpeg2000/libjasper/jpc/jpc_dec.c index 0f162051..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; } 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 <assert.h> +#include <assert.h> +#include <stdint.h> /******************************************************************************\ * 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 7485526c..55a8084f 100644 --- a/doc/HISTORY +++ b/doc/HISTORY @@ -6,10 +6,13 @@ CHANGE HISTORY not yet BJH Release 10.88.00 - jpeg2ktopam: Fix memory leak after decoder failure. Always + jpeg2ktopam, pamtojpeg2k: fix negative array index. Always broken (pamtojpeg2k was new in Netpbm 10.12 (November 2002)). - jpeg2ktopam, pamtojpeg2k: fix negative array index. Always + 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 |