diff --git a/src/Apache.Arrow/C/CArrowArrayImporter.cs b/src/Apache.Arrow/C/CArrowArrayImporter.cs index c454380e..2dc4adba 100644 --- a/src/Apache.Arrow/C/CArrowArrayImporter.cs +++ b/src/Apache.Arrow/C/CArrowArrayImporter.cs @@ -470,7 +470,10 @@ private ArrowBuffer[] ImportFixedWidthBuffers(CArrowArray* cArray, int bitWidth) int length = checked((int)cArray->offset + (int)cArray->length); int valuesLength; if (bitWidth >= 8) - valuesLength = checked(length * bitWidth / 8); + { + Debug.Assert(bitWidth % 8 == 0); + valuesLength = checked((int)((ulong)length * (ulong)bitWidth / 8ul)); + } else valuesLength = checked((int)BitUtility.RoundUpToMultipleOf8(length) / 8);