]> granicus.if.org Git - openjpeg/commitdiff
[trunk] WIP: fix get_decoded_tile function to avoid error with output image
authorMickael Savinaud <savmickael@users.noreply.github.com>
Wed, 9 Nov 2011 16:15:15 +0000 (16:15 +0000)
committerMickael Savinaud <savmickael@users.noreply.github.com>
Wed, 9 Nov 2011 16:15:15 +0000 (16:15 +0000)
CHANGES
libopenjpeg/j2k.c
tests/nonregression/CMakeLists.txt

diff --git a/CHANGES b/CHANGES
index 059918e93201a14b90e5a737d2cf7e2d49b5890f..341177a0e14f5c4b75a3842cb4b797919aa4e5d1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@ What's New for OpenJPEG
 + : added
 
 November 9, 2011
+* [mickael] WIP: fix get_decoded_tile function to avoid error with output image
 * [mickael] fix bug with mj2 applications (credit to winfried)
 + [mickael] enhance mj2 when read jp2h (credit to winfried)
 + [mickael] check if the file extension is the same as the infile format (credit to winfried)
index 281b087fc9d7cd677052540d3f0eab6c5d41e6b0..379f8bee73a3d5e358034cbdf0e5299f8a214be3 100644 (file)
@@ -8376,9 +8376,18 @@ opj_bool j2k_get_tile(   opj_j2k_v2_t *p_j2k,
        l_tile_y = tile_index / p_j2k->m_cp.tw;
 
        p_image->x0 = l_tile_x * p_j2k->m_cp.tdx + p_j2k->m_cp.tx0;
+       if (p_image->x0 < p_j2k->m_private_image->x0)
+               p_image->x0 = p_j2k->m_private_image->x0;
        p_image->x1 = (l_tile_x + 1) * p_j2k->m_cp.tdx + p_j2k->m_cp.tx0;
+       if (p_image->x1 > p_j2k->m_private_image->x1)
+               p_image->x1 = p_j2k->m_private_image->x1;
+
        p_image->y0 = l_tile_y * p_j2k->m_cp.tdy + p_j2k->m_cp.ty0;
+       if (p_image->y0 < p_j2k->m_private_image->y0)
+               p_image->y0 = p_j2k->m_private_image->y0;
        p_image->y1 = (l_tile_y + 1) * p_j2k->m_cp.tdy + p_j2k->m_cp.ty0;
+       if (p_image->y1 > p_j2k->m_private_image->y1)
+               p_image->y1 = p_j2k->m_private_image->y1;
 
        l_img_comp = p_image->comps;
        for (compno=0; compno < p_image->numcomps; ++compno)
index ec100e427d78399458cbfe7ebefe5bced2f30ff2..8d63f7e2de867d01d9e80a75df761cdf6fdcf72e 100644 (file)
@@ -96,7 +96,7 @@ IF (TEST_SUITE_FILES)
     
     # Avoid to process the official test suite
     SET(FILE_ALREADY_READ 0)
-    STRING(REGEX MATCH "test_suite.ctest.in$" FILE_ALREADY_READ ${TEST_SUITE_FILE})
+    STRING(REGEX MATCH "^test_suite.ctest.in$" FILE_ALREADY_READ ${TEST_SUITE_FILE})
    
     IF(NOT FILE_ALREADY_READ) 
       # Configure the additional test suite file: