Avoid assertion in opj_j2k_merge_ppt() in case premature EOC is encountered in opj_j2k_read_tile_header(). Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2785. Credit to OSS Fuzz

This commit is contained in:
Even Rouault 2017-07-29 16:22:36 +02:00
parent 71b4f5b124
commit 9906fbf737
1 changed files with 1 additions and 4 deletions

View File

@ -8618,10 +8618,7 @@ OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t * p_j2k,
/* Current marker is the EOC marker ?*/ /* Current marker is the EOC marker ?*/
if (l_current_marker == J2K_MS_EOC) { if (l_current_marker == J2K_MS_EOC) {
if (p_j2k->m_specific_param.m_decoder.m_state != J2K_STATE_EOC) { 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;
}
} }
/* FIXME DOC ???*/ /* FIXME DOC ???*/