FBX: Replace bad pointer casting with memcpy
authorTuro Lamminen <turotl@gmail.com>
Sat, 7 Oct 2017 17:40:35 +0000 (20:40 +0300)
committerTuro Lamminen <turotl@gmail.com>
Sat, 14 Oct 2017 15:46:19 +0000 (18:46 +0300)
code/FBXBinaryTokenizer.cpp

index ede32d7..9ae3838 100644 (file)
@@ -151,7 +151,8 @@ uint32_t ReadWord(const char* input, const char*& cursor, const char* end)
         TokenizeError("cannot ReadWord, out of bounds",input, cursor);
     }
 
-    uint32_t word = *reinterpret_cast<const uint32_t*>(cursor);
+    uint32_t word;
+    memcpy(&word, cursor, 4);
     AI_SWAP4(word);
 
     cursor += k_to_read;