Avoid assertion when running opj_j2k_merge_ppt() several time due to e6674f7ed66abdb32a0be5944f618722b6a7b5d5 revert. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2785

This commit is contained in:
Even Rouault 2018-06-20 14:54:09 +02:00
parent 832dfd1866
commit 0c913b0aba
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
1 changed files with 6 additions and 1 deletions

View File

@ -4094,7 +4094,12 @@ static OPJ_BOOL opj_j2k_merge_ppt(opj_tcp_t *p_tcp, opj_event_mgr_t * p_manager)
/* preconditions */
assert(p_tcp != 00);
assert(p_manager != 00);
assert(p_tcp->ppt_buffer == NULL);
if (p_tcp->ppt_buffer != NULL) {
opj_event_msg(p_manager, EVT_ERROR,
"opj_j2k_merge_ppt() has already been called\n");
return OPJ_FALSE;
}
if (p_tcp->ppt == 0U) {
return OPJ_TRUE;