Memory leak bug fixed in the read_mdat() function

This commit is contained in:
Francois-Olivier Devaux 2004-10-06 08:58:27 +00:00
parent e1278bc691
commit 2410db2ae7
1 changed files with 5 additions and 0 deletions

View File

@ -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;