Skip to content

Commit

Permalink
Merge pull request #1565 from rouault/fix_1564
Browse files Browse the repository at this point in the history
opj_j2k_add_tlmarker(): validate that current tile-part number if smaller that total number of tile-parts
  • Loading branch information
rouault authored Nov 25, 2024
2 parents d5573aa + e492644 commit a1a56ff
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 @@ -8459,7 +8459,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 a1a56ff

Please sign in to comment.