diff --git a/sample_source.cc b/sample_source.cc index d1e8d32..8f187e8 100644 --- a/sample_source.cc +++ b/sample_source.cc @@ -102,6 +102,8 @@ void StdinSampleSource::ScheduleRead() { return; } + block_.resize(block_.capacity()); + auto self = shared_from_this(); stream_.async_read_some(boost::asio::buffer(block_.data() + used_, block_.size() - used_), [this, self](const boost::system::error_code &ec, std::size_t bytes_transferred) { if (ec) {