Merge pull request #1256 from sebras/master

openjp2: Error out if failing to create Tier 1 handle.
This commit is contained in:
Even Rouault 2020-06-22 21:03:23 +02:00 committed by GitHub
commit 98150d0942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -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;