Skip to content

Commit

Permalink
If less than 2 bytes left, there will not be another SOT or an EOC
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 26, 2024
1 parent eb25a5e commit 372cd6f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -5119,6 +5119,8 @@ static OPJ_BOOL opj_j2k_read_sod(opj_j2k_t *p_j2k,
return OPJ_FALSE;
}
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;
} else if (opj_stream_get_number_byte_left(p_stream) < 2) {
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_NEOC;
} else {
p_j2k->m_specific_param.m_decoder.m_state = J2K_STATE_TPHSOT;
}
Expand Down

0 comments on commit 372cd6f

Please sign in to comment.