diff --git a/CHANGES b/CHANGES index a484fcb8..9816c14e 100644 --- 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 diff --git a/libopenjpeg/t2.c b/libopenjpeg/t2.c index 48463c9c..4af8eb84 100644 --- a/libopenjpeg/t2.c +++ b/libopenjpeg/t2.c @@ -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 */