fixed another bug related to the number of packets in a tile-part, not correctly...
authorAntonin Descampe <antonin@gmail.com>
Mon, 16 May 2011 19:39:07 +0000 (19:39 +0000)
committerAntonin Descampe <antonin@gmail.com>
Mon, 16 May 2011 19:39:07 +0000 (19:39 +0000)
CHANGES
libopenjpeg/t2.c

diff --git a/CHANGES b/CHANGES
index a484fcb86b111da1419388b1ed0e3d040882bc21..9816c14e2cf9628ab82099b2ffcf4d63d92a50f2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ What's New for OpenJPEG
 + : added
 
 May 16, 2011
+* [antonin] fixed another bug related to the number of packets in a tile-part, not correctly taken into acccount when generating an index file during decoding.
 * [antonin] fixed part of issue 69, when tile-part index is inconsistent with the total number of tile-parts
 
 May 12, 2011
index 48463c9ca28ed6bb6b66adf4fb246b83fe3c0077..4af8eb84ca698687298665b7dbc339bf7f05ecb0 100644 (file)
@@ -730,6 +730,7 @@ int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj
                                        info_PK->start_pos = info_TL->end_header + 1;
                                } else if (info_TL->packet[cstr_info->packno-1].end_pos >= (int)cstr_info->tile[tileno].tp[curtp].tp_end_pos){ // New tile part
                                        info_TL->tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; // Number of packets in previous tile-part
+          info_TL->tp[curtp].tp_start_pack = tp_start_packno;
                                        tp_start_packno = cstr_info->packno;
                                        curtp++;
                                        info_PK->start_pos = cstr_info->tile[tileno].tp[curtp].tp_end_header+1;
@@ -753,6 +754,7 @@ int t2_decode_packets(opj_t2_t *t2, unsigned char *src, int len, int tileno, opj
        /* INDEX >> */
        if(cstr_info) {
                cstr_info->tile[tileno].tp[curtp].tp_numpacks = cstr_info->packno - tp_start_packno; // Number of packets in last tile-part
+    cstr_info->tile[tileno].tp[curtp].tp_start_pack = tp_start_packno;
        }
        /* << INDEX */