summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2004-10-06 08:58:27 +0000
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>2004-10-06 08:58:27 +0000
commit2410db2ae74faaa0c82e0fa85e6ebed75a99745e (patch)
tree78be88a8cffa6dbda1ff04f54a050f6e90efc37c
parente1278bc6910dbb0749d9b670508b9c0b09c28b0b (diff)
Memory leak bug fixed in the read_mdat() function
-rw-r--r--mj2/mj2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/mj2/mj2.c b/mj2/mj2.c
index dea20bb4..90789ae3 100644
--- a/mj2/mj2.c
+++ b/mj2/mj2.c
@@ -566,6 +566,7 @@ int mj2_read_mdat(mj2_movie_t * movie, unsigned char *src, char *outfile)
unsigned int i;
int jp2c_cio_len, jp2c_len, pos_correction = 0;
FILE *f=NULL;
+ int compno;
mj2_box_t box;
@@ -637,6 +638,10 @@ int mj2_read_mdat(mj2_movie_t * movie, unsigned char *src, char *outfile)
j2k_dec_release();
+ for (compno=0; compno < img.numcomps; compno++)
+ free(img.comps[compno].data);
+
+
if (cio_tell() + 8 != jp2c_len) {
fprintf(stderr, "Error with JP2C Box Size\n");
return 1;