From 5c363b76eeeea843967103f839d2ef68c8cc2499 Mon Sep 17 00:00:00 2001 From: Mickael Savinaud Date: Thu, 1 Dec 2011 13:46:09 +0000 Subject: [PATCH] [trunk] fix a bug during the creation of the codestream index --- CHANGES | 1 + libopenjpeg/j2k.c | 2 +- tests/nonregression/test_suite.ctest.in | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 6ca91d31..2e81110f 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,7 @@ What's New for OpenJPEG + : added December 1, 2011 +* [mickael] fix a bug during the creation of the codestream index * [mickael] fix a warning about a recent commit (1104) * [jmalik] fix warnings when printing large integers diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 660e91b0..f1662a69 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -8114,7 +8114,7 @@ opj_bool j2k_allocate_tile_element_cstr_index(opj_j2k_v2_t *p_j2k) { OPJ_UINT32 it_tile=0; - p_j2k->cstr_index->nb_of_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.tw; + p_j2k->cstr_index->nb_of_tiles = p_j2k->m_cp.tw * p_j2k->m_cp.th; p_j2k->cstr_index->tile_index = (opj_tile_index_t*)opj_calloc(p_j2k->cstr_index->nb_of_tiles, sizeof(opj_tile_index_t)); if (!p_j2k->cstr_index->tile_index) return OPJ_FALSE; diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in index d61bb5de..ce579fff 100644 --- a/tests/nonregression/test_suite.ctest.in +++ b/tests/nonregression/test_suite.ctest.in @@ -113,6 +113,8 @@ j2k_to_image -i @INPUT_CONF_PATH@/p1_06.j2k -o @TEMP_PATH@/p1_06_1.j2k_t5.png -t j2k_to_image -i @INPUT_CONF_PATH@/p1_06.j2k -o @TEMP_PATH@/p1_06_2.j2k_t9.png -t 9 -r 2 j2k_to_image -i @INPUT_CONF_PATH@/p1_06.j2k -o @TEMP_PATH@/p1_06_3.j2k_t15.png -t 15 -r 2 +j2k_to_image -i @INPUT_CONF_PATH@/p1_06.j2k -o @TEMP_PATH@/p1_06.j2k_r4.png -r 4 + # prec=4; nb_c=3 ; signd=yes j2k_to_image -i @INPUT_CONF_PATH@/p0_04.j2k -o @TEMP_PATH@/p0_04.j2k.png -d 0,0,256,256 j2k_to_image -i @INPUT_CONF_PATH@/p0_04.j2k -o @TEMP_PATH@/p0_04_1.j2k.png -d 128,0,256,128