Patch by Callum Lerwick. Fixed error during encoding using tile option in tcd.c

This commit is contained in:
Parvatha Elangovan 2008-01-04 15:43:57 +00:00
parent 4619a94ebf
commit 4051e87d06
2 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,9 @@ What's New for OpenJPEG
! : changed ! : changed
+ : added + : added
January 4, 2008
* [Parvatha] Patch by Callum Lerwick. Fixed bug during encoding using tile option in tcd.c
---------------------- ----------------------
December 21, 2007 December 21, 2007
VERSION 1.3.0 RELEASED VERSION 1.3.0 RELEASED

View File

@ -584,7 +584,9 @@ void tcd_init_encode(opj_tcd_t *tcd, opj_image_t * image, opj_cp_t * cp, int cur
cblk->y0 = int_max(cblkystart, prc->y0); cblk->y0 = int_max(cblkystart, prc->y0);
cblk->x1 = int_min(cblkxend, prc->x1); cblk->x1 = int_min(cblkxend, prc->x1);
cblk->y1 = int_min(cblkyend, prc->y1); cblk->y1 = int_min(cblkyend, prc->y1);
cblk->data = (unsigned char*) opj_calloc(8192, sizeof(unsigned char)); cblk->data = (unsigned char*) opj_calloc(8192+2, sizeof(unsigned char));
/* FIXME: mqc_init_enc and mqc_byteout underrun the buffer if we don't do this. Why? */
cblk->data += 2;
cblk->layers = (opj_tcd_layer_t*) opj_calloc(100, sizeof(opj_tcd_layer_t)); cblk->layers = (opj_tcd_layer_t*) opj_calloc(100, sizeof(opj_tcd_layer_t));
cblk->passes = (opj_tcd_pass_t*) opj_calloc(100, sizeof(opj_tcd_pass_t)); cblk->passes = (opj_tcd_pass_t*) opj_calloc(100, sizeof(opj_tcd_pass_t));
} }
@ -1504,3 +1506,4 @@ void tcd_free_decode_tile(opj_tcd_t *tcd, int tileno) {
} }