Skip to content

Commit

Permalink
Merge pull request #1256 from sebras/master
Browse files Browse the repository at this point in the history
openjp2: Error out if failing to create Tier 1 handle.
  • Loading branch information
rouault authored Jun 22, 2020
2 parents 25fb144 + 93b9f72 commit 98150d0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib/openjp2/t1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,13 @@ static void opj_t1_clbl_decode_processor(void* user_data, opj_tls_t* tls)
t1 = (opj_t1_t*) opj_tls_get(tls, OPJ_TLS_KEY_T1);
if (t1 == NULL) {
t1 = opj_t1_create(OPJ_FALSE);
if (t1 == NULL) {
opj_event_msg(job->p_manager, EVT_ERROR,
"Cannot allocate Tier 1 handle\n");
*(job->pret) = OPJ_FALSE;
opj_free(job);
return;
}
opj_tls_set(tls, OPJ_TLS_KEY_T1, t1, opj_t1_destroy_wrapper);
}
t1->mustuse_cblkdatabuffer = job->mustuse_cblkdatabuffer;
Expand Down

0 comments on commit 98150d0

Please sign in to comment.