Update the README.cmake file : an instruction was missing to run the tests correctly.
[openjpeg.git] / libopenjpeg / t2.c
index a841cf0b1a3f9d71a2dd74367e980f373a5e6577..a76f4ed26cbe2beb88437e887a1a6849ce335cdf 100644 (file)
@@ -612,7 +612,11 @@ int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlaye
                        for(poc = 0; poc < pocno ; poc++){
                                int comp_len = 0;
                                int tpnum = compno;
-                               pi_create_encode(pi, cp,tileno,poc,tpnum,tppos,t2_mode,cur_totnum_tp); 
+                               if (pi_create_encode(pi, cp,tileno,poc,tpnum,tppos,t2_mode,cur_totnum_tp)) {
+                                       opj_event_msg(t2->cinfo, EVT_ERROR, "Error initializing Packet Iterator\n");
+                                       pi_destroy(pi, cp, tileno);
+                                       return -999;
+                               }
                                while (pi_next(&pi[poc])) {
                                        if (pi[poc].layno < maxlayers) {
                                                e = t2_encode_packet(tile, &cp->tcps[tileno], &pi[poc], c, dest + len - c, cstr_info, tileno);