Skip to content

Commit

Permalink
Avoid assertion in opj_j2k_merge_ppt() in case premature EOC is encou…
Browse files Browse the repository at this point in the history
…ntered in opj_j2k_read_tile_header(). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2785. Credit to OSS Fuzz
  • Loading branch information
rouault committed Jul 29, 2017
1 parent 71b4f5b commit 9906fbf
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -8618,10 +8618,7 @@ OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t * p_j2k,

/* Current marker is the EOC marker ?*/
if (l_current_marker == J2K_MS_EOC) {
if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_EOC) {
p_j2k->m_current_tile_number = 0;
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
}
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_EOC;
}

/* FIXME DOC ???*/
Expand Down

0 comments on commit 9906fbf

Please sign in to comment.