Skip to content

Commit

Permalink
Avoid assertion when running opj_j2k_merge_ppt() several time due to …
Browse files Browse the repository at this point in the history
…e6674f7ed66abdb32a0be5944f618722b6a7b5d5 revert. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2785
  • Loading branch information
rouault committed Jun 20, 2018
1 parent 832dfd1 commit 0c913b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/openjp2/j2k.c
Expand Up @@ -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;
Expand Down

0 comments on commit 0c913b0

Please sign in to comment.