Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cpp/src/arrow/ipc/reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,14 @@ Result<std::shared_ptr<SparseIndex>> ReadSparseCOOIndex(
file->ReadAt(indices_buffer->offset(), indices_buffer->length(),
/*allow_short_read=*/false));
std::vector<int64_t> indices_shape({non_zero_length, ndim});
int64_t indices_minimum_bytes;
if (MultiplyWithOverflow(non_zero_length, ndim,
&indices_minimum_bytes) ||
MultiplyWithOverflow(indices_minimum_bytes, indices_elsize,
&indices_minimum_bytes) ||
Comment thread
rok marked this conversation as resolved.
Outdated
indices_minimum_bytes > indices_buffer->length()) {
return Status::Invalid("shape is inconsistent to the size of indices buffer");
}
auto* indices_strides = sparse_index->indicesStrides();
std::vector<int64_t> strides(2);
if (indices_strides && indices_strides->size() > 0) {
Expand Down
Loading