Skip to content

Commit

Permalink
Merge pull request #1561 from rouault/fix_pr_1530
Browse files Browse the repository at this point in the history
Amend fix of PR 1530 regarding m_sot_length check
  • Loading branch information
rouault authored Nov 13, 2024
2 parents 4ec0aca + c34e441 commit 05de3bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 05de3bf

Please sign in to comment.