From 2d8739729a1cef396e7056c9d379db8a03d7b298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle?= Date: Mon, 5 Oct 2026 19:13:58 +0200 Subject: [PATCH] fix(buffer): advance across empty corded slices (FB-4526) --- cpp/src/arrow/corded_buffer.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cpp/src/arrow/corded_buffer.cc b/cpp/src/arrow/corded_buffer.cc index 04720857a776..e0fd7fc2436b 100644 --- a/cpp/src/arrow/corded_buffer.cc +++ b/cpp/src/arrow/corded_buffer.cc @@ -29,13 +29,8 @@ void CordedBuffer::Advance(size_t n) noexcept { const auto& slice = slices_[slice_idx_]; const int64_t remaining_to_skip = n - skipped; const int64_t this_slice_offset = std::exchange(slice_offset_, 0); - assert(this_slice_offset < static_cast(slice.size())); + assert(this_slice_offset <= static_cast(slice.size())); const int64_t available_in_slice = slice.size() - this_slice_offset; - if (remaining_to_skip == available_in_slice) { - // We advanced just to the page boundary, need to advance to the next page - ++slice_idx_; - return; - } if (remaining_to_skip < available_in_slice) { slice_offset_ = static_cast(remaining_to_skip + this_slice_offset); return;