mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 01:00:48 +00:00
Fix bug found on review
This commit is contained in:
parent
d69fc35dd9
commit
eb3a651bab
@ -151,10 +151,14 @@ void ZstdDeflatingAppendableWriteBuffer::finishImpl()
|
||||
void ZstdDeflatingAppendableWriteBuffer::addEmptyBlock()
|
||||
{
|
||||
/// HACK: https://github.com/facebook/zstd/issues/2090#issuecomment-620158967
|
||||
out.nextIfAtEnd();
|
||||
static const char empty_block[3] = {0x01, 0x00, 0x00};
|
||||
|
||||
if (out.buffer().size() - out.offset() < sizeof(empty_block))
|
||||
out.next();
|
||||
|
||||
std::memcpy(out.buffer().begin() + out.offset(), empty_block, sizeof(empty_block));
|
||||
out.position() = out.buffer().begin() + sizeof(empty_block);
|
||||
|
||||
out.position() = out.buffer().begin() + out.offset() + sizeof(empty_block);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user