Skip to content

Commit 15c7b1d

Browse files
committed
Fix a rare issue where the decompressor fails due to a buffer too small
1 parent 17fc975 commit 15c7b1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transform/ROLZCodec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ bool ROLZCodec1::inverse(SliceArray<byte>& input, SliceArray<byte>& output, int
473473
try
474474
{
475475
// Decode literal, length and match index buffers
476-
istreambuf<char> buffer(reinterpret_cast<char*>(&src[srcIdx]), max(min(count - srcIdx, sizeChunk + 16), 0));
476+
istreambuf<char> buffer(reinterpret_cast<char*>(&src[srcIdx]), max(min(count - srcIdx, sizeChunk + 16), 65536));
477477
istream is(&buffer);
478478
DefaultInputBitStream ibs(is, 65536);
479479
const int litLen = int(ibs.readBits(32));

0 commit comments

Comments
 (0)