Skip to content

Commit

Permalink
t2: fix include buffer overflow
Browse files Browse the repository at this point in the history
fixes buganizer #5453901339361280
  • Loading branch information
Grok Compression committed Jan 31, 2025
1 parent aa61ec4 commit d044b11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/lib/core/t2/PacketIter.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,12 @@ struct LayerIncludeBuffers
if(chunks.find(chunkIndex) == chunks.end())
chunks[chunkIndex] =
new uint8_t[GRK_INCLUDE_TRACKER_CHUNK_SIZE](); // Allocate chunk lazily

auto include = chunks[chunkIndex] + chunkOffset;
uint8_t bit = (bitIndex & 7);
uint8_t val = include[byteIndex];
uint8_t val = *include;
if(((val >> bit) & 1) == 0)
{
include[byteIndex] = (uint8_t)(val | (1 << bit));
*include = (uint8_t)(val | (1 << bit));
return true;
}

Expand Down

0 comments on commit d044b11

Please sign in to comment.