Merge pull request #1561 from rouault/fix_pr_1530

Amend fix of PR 1530 regarding m_sot_length check
This commit is contained in:
Even Rouault 2024-11-13 17:48:49 +01:00 committed by GitHub
commit 05de3bfdfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9792,7 +9792,8 @@ OPJ_BOOL opj_j2k_read_tile_header(opj_j2k_t * p_j2k,
}
/* Why this condition? FIXME */
if (p_j2k->m_specific_param.m_decoder.m_state & J2K_STATE_TPH) {
if ((p_j2k->m_specific_param.m_decoder.m_state & J2K_STATE_TPH) &&
p_j2k->m_specific_param.m_decoder.m_sot_length != 0) {
if (p_j2k->m_specific_param.m_decoder.m_sot_length < l_marker_size + 2) {
opj_event_msg(p_manager, EVT_ERROR,
"Sot length is less than marker size + marker ID\n");