Fixed allocation problem in pi.c
authorFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Wed, 19 Dec 2007 13:57:57 +0000 (13:57 +0000)
committerFrancois-Olivier Devaux <fodevaux@users.noreply.github.com>
Wed, 19 Dec 2007 13:57:57 +0000 (13:57 +0000)
ChangeLog
libopenjpeg/pi.c

index eeafa865ce504f3bd28fca8e4799e39fd19bc4e1..96f307975cf33642f566ef33210d7e17021bf8dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@ What's New for OpenJPEG
 
 December 19, 2007
 ! [Parvatha] In pi.c, removed the Recursive function pi_check_next_level() and modified the code.
+* [FOD] Fixed allocation problem in pi.c
 
 December 19, 2007
 + [FOD] In mqc.h, changed MQC_NUMCTXS from 32 to 19 as there are only 19 possible contexts
index 7bd571eac2d1ea7a290d24b507608c9de0f2d27d..45de9031da3ba097375c123921fd90c345336e2c 100644 (file)
@@ -727,7 +727,7 @@ bool pi_next(opj_pi_iterator_t * pi) {
 }
 
 void pi_create_encode( opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,int tpnum, int tppos, J2K_T2_MODE t2_mode,int cur_totnum_tp){
-       char *prog;
+       char prog[4];
        int i;
        int incr_top=1,resetX=0;
        opj_tcp_t *tcps =&cp->tcps[tileno];
@@ -735,7 +735,6 @@ void pi_create_encode( opj_pi_iterator_t *pi, opj_cp_t *cp,int tileno, int pino,
 
        pi[pino].first = 1;
        pi[pino].poc.prg = tcp->prg;
-       prog = (char*)malloc(4*sizeof(char));
 
        switch(tcp->prg){
                case CPRL: strncpy(prog, "CPRL",4);