Commit 825f248 1 parent 6aea9ed commit 825f248 Copy full SHA for 825f248
File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -395,7 +395,7 @@ namespace orc {
395
395
int64_t bits = 0 ;
396
396
if (bufferEnd_ - bufferPointer_ >= 8 ) {
397
397
if (isLittleEndian) {
398
- bits = *( reinterpret_cast < const int64_t *>(bufferPointer_ ));
398
+ memcpy (& bits, bufferPointer_, sizeof (bits ));
399
399
} else {
400
400
bits = static_cast <int64_t >(static_cast <unsigned char >(bufferPointer_[0 ]));
401
401
bits |= static_cast <int64_t >(static_cast <unsigned char >(bufferPointer_[1 ])) << 8 ;
@@ -509,8 +509,10 @@ namespace orc {
509
509
bufferNum = std::min (numValues,
510
510
static_cast <size_t >(bufferEnd_ - bufferPointer_) / bytesPerValue_);
511
511
uint64_t bufferBytes = bufferNum * bytesPerValue_;
512
- memcpy (outArray, bufferPointer_, bufferBytes);
513
- bufferPointer_ += bufferBytes;
512
+ if (bufferBytes > 0 ) {
513
+ memcpy (outArray, bufferPointer_, bufferBytes);
514
+ bufferPointer_ += bufferBytes;
515
+ }
514
516
}
515
517
for (size_t i = bufferNum; i < numValues; ++i) {
516
518
outArray[i] = readDouble<ValueType>();
You can’t perform that action at this time.
0 commit comments