aboutsummaryrefslogtreecommitdiff
path: root/src/common/io/BufferStream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/io/BufferStream.cpp')
-rw-r--r--src/common/io/BufferStream.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/io/BufferStream.cpp b/src/common/io/BufferStream.cpp
index 3060a608..242396cd 100644
--- a/src/common/io/BufferStream.cpp
+++ b/src/common/io/BufferStream.cpp
@@ -75,6 +75,10 @@ Index BufferStream::Write(const std::byte* buffer, Index offset, Index size) {
Index written = 0;
+ if (empty) {
+ buffer_list_.push_back(Buffer(block_size_));
+ }
+
while (true) {
if (buffer_list_.back().GetBackFree() == 0) {
if (max_block_count_ > 0 && buffer_list_.size() == max_block_count_) {