summaryrefslogtreecommitdiff
path: root/libopenjpeg/t2.c
diff options
context:
space:
mode:
authorParvatha Elangovan <p.elangovan@intopix.com>2007-09-18 13:07:29 +0000
committerParvatha Elangovan <p.elangovan@intopix.com>2007-09-18 13:07:29 +0000
commita6ba04cdf49772f2e90515b277f174a0849bc8b6 (patch)
tree3e6c84b511eea2b4e8cdee54b8b346d9846e1251 /libopenjpeg/t2.c
parent55c4c14352519b84ad79abcb2f8527e1c25b9e54 (diff)
Fixed issues with Reading and Writing TIF images in convert.c to avoid segmentation fault.
Fixed issues relating to using user specified rates for CINEMA option for multiple images.
Diffstat (limited to 'libopenjpeg/t2.c')
-rw-r--r--libopenjpeg/t2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libopenjpeg/t2.c b/libopenjpeg/t2.c
index 5692a1ec..84d8bee7 100644
--- a/libopenjpeg/t2.c
+++ b/libopenjpeg/t2.c
@@ -591,6 +591,7 @@ int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlaye
int poc;
opj_image_t *image = t2->image;
opj_cp_t *cp = t2->cp;
+ opj_tcp_t *tcp = &cp->tcps[tileno];
int pocno = cp->cinema == CINEMA4K_24? 2: 1;
int maxcomp = cp->max_comp_size > 0 ? image->numcomps : 1;
@@ -645,7 +646,7 @@ int t2_encode_packets(opj_t2_t* t2,int tileno, opj_tcd_tile_t *tile, int maxlaye
if (!cstr_info->packno) {
info_PK->start_pos = info_TL->end_header + 1;
} else {
- info_PK->start_pos = (cp->tp_on && info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
+ info_PK->start_pos = ((cp->tp_on | tcp->POC)&& info_PK->start_pos) ? info_PK->start_pos : info_TL->packet[cstr_info->packno - 1].end_pos + 1;
}
info_PK->end_pos = info_PK->start_pos + e - 1;
info_PK->end_ph_pos += info_PK->start_pos - 1; // End of packet header which now only represents the distance