Skip to content

Commit d044b11

Browse files
author
Grok Compression
committed
t2: fix include buffer overflow
fixes buganizer #5453901339361280
1 parent aa61ec4 commit d044b11

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/lib/core/t2/PacketIter.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,12 @@ struct LayerIncludeBuffers
9898
if(chunks.find(chunkIndex) == chunks.end())
9999
chunks[chunkIndex] =
100100
new uint8_t[GRK_INCLUDE_TRACKER_CHUNK_SIZE](); // Allocate chunk lazily
101-
102101
auto include = chunks[chunkIndex] + chunkOffset;
103102
uint8_t bit = (bitIndex & 7);
104-
uint8_t val = include[byteIndex];
103+
uint8_t val = *include;
105104
if(((val >> bit) & 1) == 0)
106105
{
107-
include[byteIndex] = (uint8_t)(val | (1 << bit));
106+
*include = (uint8_t)(val | (1 << bit));
108107
return true;
109108
}
110109

0 commit comments

Comments
 (0)