diff options
| author | Antonin Descampe <antonin@gmail.com> | 2005-09-20 15:40:13 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2005-09-20 15:40:13 +0000 |
| commit | a0513798bb231e7c770c1c488e880afe8359772d (patch) | |
| tree | 6fbe01fc08256e6523f5fd8b0fe11e4c44a6bce1 /libopenjpeg | |
| parent | 8f4d6bbeba925d62d58cbf7a6526652e2fb863d1 (diff) | |
bug fixed when asking for an index with more than (layer*resolutions*100) packets per tile
Diffstat (limited to 'libopenjpeg')
| -rw-r--r-- | libopenjpeg/j2k.c | 4 | ||||
| -rw-r--r-- | libopenjpeg/tcd.c | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 0af9f18a..65a08bfc 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -875,10 +875,6 @@ void j2k_write_sod() if (info_IM.index_on) { info_IM.tile[j2k_curtileno].end_header = cio_tell() + pos_correction - 1; - info_IM.tile[j2k_curtileno].packet = - (info_packet *) calloc(info_IM.Comp * info_IM.Layer * - (info_IM.Decomposition + 1) * 100, - sizeof(info_packet)); } /* << INDEX */ diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index f39d3403..3c8abf60 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -1156,7 +1156,7 @@ tcd_encode_tile_pxm(int tileno, unsigned char *dest, int len, info_image * info_IM) { int compno; - int l, i; + int l, i, npck=0; clock_t time7; tcd_tile_t *tile; j2k_tcp_t *tcp = &tcd_cp->tcps[0]; @@ -1176,11 +1176,14 @@ tcd_encode_tile_pxm(int tileno, unsigned char *dest, int len, info_IM->tile[tileno].pw[i] = res_idx->pw; info_IM->tile[tileno].ph[i] = res_idx->ph; + + npck+=res_idx->pw * res_idx->ph; info_IM->tile[tileno].pdx[i] = tccp->prcw[i]; info_IM->tile[tileno].pdy[i] = tccp->prch[i]; } + info_IM->tile[tileno].packet = (info_packet *) calloc(info_IM->Comp * info_IM->Layer * npck, sizeof(info_packet)); } /* << INDEX */ |
