Allocated memory of coding parameters (cp) freed
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Wed, 14 Jul 2004 10:58:11 +0000 (10:58 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Wed, 14 Jul 2004 10:58:11 +0000 (10:58 +0000)
codec/image_to_j2k.c

index d0d49f13a664a4a215131ba51b4fc1edb5a72b96..56508c11b2dcd26ae43407dc95eadacb16b5b857 100644 (file)
@@ -850,6 +850,7 @@ int main(int argc, char **argv)
     }
     fwrite(outbuf, 1, len, f);
     free(outbuf);
+    free(jp2_struct->comps);
     fclose(f);
   }
 
@@ -874,6 +875,13 @@ int main(int argc, char **argv)
     }
   }
 
+  /* Free memory */
+  free(cp_init.tcps);
+  if (tcp_init->numlayers > 9) free(cp.matrice);
+  for (tileno = 0; tileno < cp.tw * cp.th; tileno++)
+    free(cp.tcps[tileno].tccps);
+  free(cp.tcps);
+
   system("pause");
   return 0;
 }