diff options
| author | Parvatha Elangovan <p.elangovan@intopix.com> | 2008-01-04 15:43:57 +0000 |
|---|---|---|
| committer | Parvatha Elangovan <p.elangovan@intopix.com> | 2008-01-04 15:43:57 +0000 |
| commit | 4051e87d06a22a1372c54f3a26a97d0d40222f6e (patch) | |
| tree | c0dd7525e8556d1bee69ffe01c0f665fcdc77c5b /libopenjpeg/tcd.c | |
| parent | 4619a94ebfe4af25f3fd95074b02b7d8ad50ac88 (diff) | |
Patch by Callum Lerwick. Fixed error during encoding using tile option in tcd.c
Diffstat (limited to 'libopenjpeg/tcd.c')
| -rw-r--r-- | libopenjpeg/tcd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libopenjpeg/tcd.c b/libopenjpeg/tcd.c index f4a54553..be6f8f27 100644 --- a/libopenjpeg/tcd.c +++ b/libopenjpeg/tcd.c @@ -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->x1 = int_min(cblkxend, prc->x1); 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->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) { } + |
