[v1.4]Fixed issue 6 on google code. Variable "pi" not freed or pointed-to in function...
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 8 Apr 2010 20:19:54 +0000 (20:19 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Thu, 8 Apr 2010 20:19:54 +0000 (20:19 +0000)
[v1.4]Fixed problem with Borland C++ Builder (Borland C do not have lrintf). Thanks Marek Mauder for this fix.

ChangeLog
libopenjpeg/mqc.c
libopenjpeg/opj_includes.h
libopenjpeg/t2.c

index 4e6c156fe79cb27f915a2622080c7e8db8f1567a..cb138c4657175094ae9be5b7de0810e0435ea9b5 100644 (file)
--- 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.
index e26cd80be686e84f756194c48ba2b326f6147df5..5d25238ee68308308fd955ff53ddd4d05da7a5c9 100644 (file)
@@ -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) {
index a0e64a8a927d2c5d9f1aeacd0a79fb20f6c9c8dd..80d617e310d1947fc1aaa8be6f2c4f6eb0a7fc75 100644 (file)
@@ -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;
 
index be9b42a41327b2f85aeea820a83eb04225673e98..a76f4ed26cbe2beb88437e887a1a6849ce335cdf 100644 (file)
@@ -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])) {