pitrou commented on PR #51128:
URL: https://github.com/apache/arrow/pull/51128#issuecomment-6012815079
Sorry for the delay here. I don't like the proposed approach because it
starts decoding a block in `InitHeader`. This makes the code more complicated
and brittle.
I think we can do simpler. We know that each miniblock requires at least one
byte for its bitwidth.
So the check can look like:
```c++
const int64_t required_blocks = CeilDiv(total_value_count_ - 1,
values_per_block_);
if (required_blocks * mini_blocks_per_block > decoder_->bytes_left()) {
/* throw exception */ }
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]