bug fixed when freeing the memory allocated if ppm-marker or ppt-marker is used
authorAntonin Descampe <antonin@gmail.com>
Tue, 13 Sep 2005 14:11:41 +0000 (14:11 +0000)
committerAntonin Descampe <antonin@gmail.com>
Tue, 13 Sep 2005 14:11:41 +0000 (14:11 +0000)
codec/image_to_j2k.c
libopenjpeg/j2k.h

index e64616abf99cb8875955b05a4b45a3c47f8c9082..9be55998405eaa5b8c2447d2c62908f085559ae7 100644 (file)
@@ -740,6 +740,7 @@ int main(int argc, char **argv)
   /* Initialization for PPM marker */
   cp.ppm = 0;
   cp.ppm_data = NULL;
+  cp.ppm_data_first = NULL;
   cp.ppm_previous = 0;
   cp.ppm_store = 0;
 
@@ -761,6 +762,7 @@ int main(int argc, char **argv)
     tcp->mct = img.numcomps == 3 ? 1 : 0;
     tcp->ppt = 0;
     tcp->ppt_data = NULL;
+    tcp->ppt_data_first = NULL;
     tcp->ppt_store = 0;
 
     numpocs_tile = 0;
index 2ebdeb2c613c9574bd145298b73d427ca645409a..e3fb36d71485191cf9f320ebb6041d215917f7aa 100644 (file)
@@ -125,6 +125,7 @@ typedef struct {
   int POC;                     /* Precise if a POC marker has been used O:NO, 1:YES                 */
   j2k_poc_t pocs[32];          /* progression order changes                                         */
   unsigned char *ppt_data;     /* packet header store there for futur use in t2_decode_packet       */
+  unsigned char *ppt_data_first;       /* pointer remaining on the first byte of the first header if ppt is used */
   int ppt;                     /* If ppt == 1 --> there was a PPT marker for the present tile       */
   int ppt_store;               /* Use in case of multiple marker PPT (number of info already store) */
   int ppt_len;                 /* ppmbug1 */
@@ -149,6 +150,7 @@ typedef struct {
   int *tileno;                 /* ID number of the tiles present in the codestream */
   int tileno_size;             /* size of the vector tileno */
   unsigned char *ppm_data;     /* packet header store there for futur use in t2_decode_packet             */
+  unsigned char *ppm_data_first;       /* pointer remaining on the first byte of the first header if ppm is used */
   int ppm;                     /* If ppm == 1 --> there was a PPM marker for the present tile             */
   int ppm_store;               /* Use in case of multiple marker PPM (number of info already store)       */
   int ppm_previous;            /* Use in case of multiple marker PPM (case on non-finished previous info) */