From ef492927cefc16ad8733ec08bcc8df5434dbb1ae Mon Sep 17 00:00:00 2001 From: Jeongseok Lee Date: Fri, 21 Jun 2024 20:22:35 -0700 Subject: [PATCH] Fix alignment issue in read() --- src/ofbx.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ofbx.cpp b/src/ofbx.cpp index 565f4f9..93210fa 100644 --- a/src/ofbx.cpp +++ b/src/ofbx.cpp @@ -592,7 +592,7 @@ static bool decompress(const u8* in, size_t in_size, u8* out, size_t out_size) template static OptionalError read(Cursor* cursor) { if (cursor->current + sizeof(T) > cursor->end) return Error("Reading past the end"); - T value = *(const T*)cursor->current; + T value = read_value(cursor->current); cursor->current += sizeof(T); return value; }