Skip to content

Commit

Permalink
fix t2.c:1234
Browse files Browse the repository at this point in the history
  • Loading branch information
headshog committed Dec 6, 2023
1 parent 6af3931 commit dbef3c1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/openjp2/t2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,11 @@ static OPJ_BOOL opj_t2_read_packet_header(opj_t2_t* p_t2,
++i;
}

if ((OPJ_UINT32)l_band->numbps + 1 < i) {
opj_bio_destroy(l_bio);
return OPJ_FALSE;
}

l_cblk->Mb = (OPJ_UINT32)l_band->numbps;
l_cblk->numbps = (OPJ_UINT32)l_band->numbps + 1 - i;
l_cblk->numlenbits = 3;
Expand Down

0 comments on commit dbef3c1

Please sign in to comment.