mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Fixed memory unaligned read while reading font from memory for Emscripten
This commit is contained in:
parent
56bb993d63
commit
0463d6958b
1 changed files with 5 additions and 0 deletions
|
|
@ -4866,7 +4866,12 @@ bool ImBitmapFont::LoadFromMemory(const void* data, int data_size)
|
|||
{
|
||||
const unsigned char block_type = *(unsigned char*)p;
|
||||
p += sizeof(unsigned char);
|
||||
#ifdef __EMSCRIPTEN__
|
||||
ImU32 block_size;
|
||||
memcpy(&block_size, p, sizeof(ImU32));
|
||||
#else
|
||||
const ImU32 block_size = *(ImU32*)p;
|
||||
#endif
|
||||
p += sizeof(ImU32);
|
||||
|
||||
switch (block_type)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue