Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de2c4d5f authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "NativeMIDI: Fix access to unaligned 64-bit data"

parents df66e568 25f51c6a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -338,7 +338,8 @@ public:
            numMessageBytes = std::min(maxBytes, numMessageBytes);
            memcpy(buffer, readBuffer + 1, numMessageBytes);
            if (timestampPtr != nullptr) {
                *timestampPtr = *(uint64_t*)(readBuffer + readCount - sizeof(uint64_t));
                memcpy(timestampPtr, readBuffer + readCount - sizeof(uint64_t),
                        sizeof(*timestampPtr));
            }
        }
        *numBytesReceivedPtr = numMessageBytes;