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

Commit 093df80d authored by Kyle Zhang's avatar Kyle Zhang Committed by Android (Google) Code Review
Browse files

Merge "libmediadrm logging: avoid unaligned memory"

parents e788c254 322187cf
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <chrono>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <ctime>
#include <deque>
#include <endian.h>
@@ -100,7 +101,8 @@ void LogToBuffer(android_LogPriority level, const char *fmt, Args... args) {

template <typename... Args>
void LogToBuffer(android_LogPriority level, const uint8_t uuid[16], const char *fmt, Args... args) {
    const uint64_t* uuid2 = reinterpret_cast<const uint64_t*>(uuid);
    uint64_t uuid2[2] = {};
    std::memcpy(uuid2, uuid, sizeof(uuid2));
    std::string uuidFmt("uuid=[%lx %lx] ");
    uuidFmt += fmt;
    LogToBuffer(level, uuidFmt.c_str(), htobe64(uuid2[0]), htobe64(uuid2[1]), args...);