diff --git a/ChangeLog b/ChangeLog index 4e6c156f..cb138c46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ What's New for OpenJPEG + : added April 8, 2010 +* [FOD] Fixed issue 6 on google code. Variable "pi" not freed or pointed-to in function "pi_create_encode". Thanks to Kent Mein for reporting this. +* [FOD] Fixed problem with Borland C++ Builder (Borland C do not have lrintf). Thanks Marek Mauder for this fix. * [FOD] Fixed pi.c bug (issue 15 on google code). Thanks to Anton Lionel for catching this. * [FOD] Fixed MJ2 codec bugs (issues 23-24 on google code). Thanks to Winfried for these patches * [FOD] Fixed JP3D codec file format analyzer. Thanks to Kristóf Ralovich for this patch. diff --git a/libopenjpeg/mqc.c b/libopenjpeg/mqc.c index e26cd80b..5d25238e 100644 --- a/libopenjpeg/mqc.c +++ b/libopenjpeg/mqc.c @@ -560,7 +560,7 @@ void mqc_init_dec(opj_mqc_t *mqc, unsigned char *bp, int len) { mqc->a = 0x8000; } -INLINE int mqc_decode(opj_mqc_t *const mqc) { +int mqc_decode(opj_mqc_t *const mqc) { int d; mqc->a -= (*mqc->curctx)->qeval; if ((mqc->c >> 16) < (*mqc->curctx)->qeval) { diff --git a/libopenjpeg/opj_includes.h b/libopenjpeg/opj_includes.h index a0e64a8a..80d617e3 100644 --- a/libopenjpeg/opj_includes.h +++ b/libopenjpeg/opj_includes.h @@ -86,8 +86,8 @@ Most compilers implement their own version of this keyword ... #endif #endif -/* MSVC does not have lrintf */ -#ifdef _MSC_VER +/* MSVC and Borland C do not have lrintf */ +#if defined(_MSC_VER) || defined(__BORLANDC__) static INLINE long lrintf(float f){ int i; diff --git a/libopenjpeg/t2.c b/libopenjpeg/t2.c index be9b42a4..a76f4ed2 100644 --- a/libopenjpeg/t2.c +++ b/libopenjpeg/t2.c @@ -614,6 +614,7 @@ int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlaye int tpnum = compno; if (pi_create_encode(pi, cp,tileno,poc,tpnum,tppos,t2_mode,cur_totnum_tp)) { opj_event_msg(t2->cinfo, EVT_ERROR, "Error initializing Packet Iterator\n"); + pi_destroy(pi, cp, tileno); return -999; } while (pi_next(&pi[poc])) {