Skip to content

Commit

Permalink
Encoder: grow again buffer size in opj_tcd_code_block_enc_allocate_da…
Browse files Browse the repository at this point in the history
…ta() (fixes uclouvain#1283)
  • Loading branch information
rouault authored and DanielHeath committed Sep 21, 2021
1 parent ca9f403 commit c602f5e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/openjp2/tcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,10 @@ static OPJ_BOOL opj_tcd_code_block_enc_allocate_data(opj_tcd_cblk_enc_t *
/* and actually +2 required for https://github.com/uclouvain/openjpeg/issues/982 */
/* and +7 for https://github.com/uclouvain/openjpeg/issues/1283 (-M 3) */
/* and +26 for https://github.com/uclouvain/openjpeg/issues/1283 (-M 7) */
/* and +28 for https://github.com/uclouvain/openjpeg/issues/1283 (-M 44) */
/* TODO: is there a theoretical upper-bound for the compressed code */
/* block size ? */
l_data_size = 26 + (OPJ_UINT32)((p_code_block->x1 - p_code_block->x0) *
l_data_size = 28 + (OPJ_UINT32)((p_code_block->x1 - p_code_block->x0) *
(p_code_block->y1 - p_code_block->y0) * (OPJ_INT32)sizeof(OPJ_UINT32));

if (l_data_size > p_code_block->data_size) {
Expand Down

0 comments on commit c602f5e

Please sign in to comment.