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 uclouvain#1564
  • Loading branch information
rouault committed Nov 25, 2024
1 parent 2be5f14 commit 40d49d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -8459,7 +8459,7 @@ 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 40d49d8

Please sign in to comment.