Skip to content

Commit fab8a5e

Browse files
authored
Core: fix for unaligned reads crash (coronalabs#783)
1 parent 88ed9fc commit fab8a5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

librtt/Renderer/Rtt_GLCommandBuffer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,8 @@ T
14051405
GLCommandBuffer::Read()
14061406
{
14071407
Rtt_ASSERT( fOffset < fBuffer + fBytesAllocated );
1408-
T result = reinterpret_cast<T*>( fOffset )[0];
1408+
T result;
1409+
memcpy( &result, fOffset, sizeof( T ) );
14091410
fOffset += sizeof( T );
14101411
return result;
14111412
}

0 commit comments

Comments
 (0)