Skip to content

Commit ada685b

Browse files
authored
Merge af4d3d8 into 74966a9
2 parents 74966a9 + af4d3d8 commit ada685b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ydb/library/yql/providers/s3/compressors/brotli.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ bool TReadBuffer::nextImpl() {
4242
do {
4343
if (InputAvailable_ == 0 && !InputExhausted_) {
4444
InputAvailable_ = Source_.read(reinterpret_cast<char*>(InBuffer.data()), InBuffer.size());
45+
InputSize_ = InputAvailable_;
4546
if (InputAvailable_ == 0) {
4647
InputExhausted_ = true;
4748
}
@@ -52,8 +53,8 @@ bool TReadBuffer::nextImpl() {
5253
InitDecoder();
5354
}
5455

55-
auto inBuffer = const_cast<const unsigned char*>(reinterpret_cast<unsigned char*>(InBuffer.data()));
56-
auto outBuffer = reinterpret_cast<unsigned char*>(OutBuffer.data());
56+
auto inBuffer = const_cast<const unsigned char*>(reinterpret_cast<unsigned char*>(InBuffer.data()) + (InputSize_ - InputAvailable_));
57+
auto outBuffer = reinterpret_cast<unsigned char*>(OutBuffer.data()) + (OutBuffer.size() - availableOut);
5758

5859
SubstreamFinished_ = false;
5960
result = BrotliDecoderDecompressStream(

ydb/library/yql/providers/s3/compressors/brotli.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class TReadBuffer : public NDB::ReadBuffer {
2323
bool SubstreamFinished_ = false;
2424
bool InputExhausted_ = false;
2525
size_t InputAvailable_ = 0;
26+
size_t InputSize_ = 0;
2627

2728
void InitDecoder();
2829
void FreeDecoder();

0 commit comments

Comments
 (0)