[trunk] Add a temporary work around for issue 293
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 14 Mar 2014 10:54:08 +0000 (10:54 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Fri, 14 Mar 2014 10:54:08 +0000 (10:54 +0000)
As described in the bug report the default allocation mecanism for codeblock data is too small for those dataset (16bits). We would need a finer (more granular) mecanism to reallocated only on demand. For now this help the two failing tests to pass.
Fixes issue 293

src/lib/openjp2/tcd.c

index 001d4ce583c63da7ba8ee10afeae16b41f73f3eb..147bc6811c0eacf561de95574df9fed85444ceb2 100644 (file)
@@ -1006,7 +1006,7 @@ OPJ_BOOL opj_tcd_code_block_enc_allocate (opj_tcd_cblk_enc_t * p_code_block)
 {
         if (! p_code_block->data) {
 
-                p_code_block->data = (OPJ_BYTE*) opj_malloc(OPJ_J2K_DEFAULT_CBLK_DATA_SIZE); /*why +1 ?*/
+                p_code_block->data = (OPJ_BYTE*) opj_malloc(OPJ_J2K_DEFAULT_CBLK_DATA_SIZE*2); /*why +1 ?*/
                 if(! p_code_block->data) {
                         return OPJ_FALSE;
                 }