Skip to content

Commit

Permalink
opj_j2k_add_tlmarker(): validate that current tile-part number if sma…
Browse files Browse the repository at this point in the history
…ller that total number of tile-parts

Fixes #1564
  • Loading branch information
rouault committed Nov 25, 2024
1 parent 4ec0aca commit e492644
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 @@ -8456,7 +8456,8 @@ static OPJ_BOOL opj_j2k_add_tlmarker(OPJ_UINT32 tileno,
if (type == J2K_MS_SOT) {
OPJ_UINT32 l_current_tile_part = cstr_index->tile_index[tileno].current_tpsno;

if (cstr_index->tile_index[tileno].tp_index) {
if (cstr_index->tile_index[tileno].tp_index &&
l_current_tile_part < cstr_index->tile_index[tileno].nb_tps) {
cstr_index->tile_index[tileno].tp_index[l_current_tile_part].start_pos = pos;
}

Expand Down

0 comments on commit e492644

Please sign in to comment.