Memory leaks fixed
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Tue, 21 Aug 2007 12:21:35 +0000 (12:21 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Tue, 21 Aug 2007 12:21:35 +0000 (12:21 +0000)
ChangeLog
libopenjpeg/j2k.c
libopenjpeg/t2.c

index e4c72ec7745c5157792239a2a2bfc8993f9f0e45..b8cfd6206121d79b3ded8a47524b8655bc6a76f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,7 @@ August 21, 2007
 * [Parvatha] Solved problems with codec reading from image file directory when filename had more than one "." in name
 * [Callum Lerwick] Minor cleanup patch, that gets rid of a bunch of "old style declaration" warnings from Intel's compiler
 * [Callum Lerwick] Aligned malloc using Intel's _mm_malloc(). Cleanup on the t1 memory allocation, getting rid of some leftover debug code
+* [Callum Lerwick] Memory leaks fixed
 
 August 20, 2007
 + [FOD] Added support for the TGA file format in the codec
index 8fabbf96fcbc5cf35075b73ea2795cfbbbd4dcaa..f013f79ade39338430b450b579eecac1da4a873d 100644 (file)
@@ -2585,6 +2585,8 @@ bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, char *index)
        tcd_free_encode(tcd);
        tcd_destroy(tcd);
 
+       free(j2k->cur_totnum_tp);
+
        j2k_write_eoc(j2k);
        
        /* Creation of the index file */
index 6c0e012b10a2f40d222b4d51f3bbbb66dcecbb10..649493c772b187e6fe3a413e859f18eca6a1927e 100644 (file)
@@ -238,11 +238,12 @@ static int t2_encode_packet(opj_tcd_tile_t * tile, opj_tcp_t * tcp, opj_pi_itera
                        }
                }
        }
-       
+
        if (bio_flush(bio)) {
+               bio_destroy(bio);
                return -999;            /* modified to eliminate longjmp !! */
        }
-       
+
        c += bio_numbytes(bio);
 
        bio_destroy(bio);