There was an error while loading. Please reload this page.
1 parent 56d3e20 commit bd9b8f5Copy full SHA for bd9b8f5
1 file changed
cpp/src/arrow/util/rle_bitmap_internal.h
@@ -217,6 +217,12 @@ class BitPackedRunToBitMapDecoder
217
data_ = run.raw_data_ptr();
218
values_count_ = run.values_count();
219
values_read_ = 0;
220
+ // This decoder bounds all of its reads by `values_count_` alone and does not
221
+ // carry `max_read_bytes`. Its memory safety therefore relies on the producer
222
+ // having sized the run to fit the backing buffer. Check that contract here,
223
+ // at the point it is relied upon (a negative max means "unbounded").
224
+ ARROW_DCHECK(run.raw_data_max_size() < 0 ||
225
+ bit_util::BytesForBits(values_count_) <= run.raw_data_max_size());
226
}
227
228
/// Return the number of values that can be advanced.
0 commit comments