mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
Ensure aligned copy in tga_read_short
ASAN says: bitmap/tga.cpp:191:5: runtime error: load of misaligned address 0x51e000003081 for type 'int16_t', which requires 2 byte alignment
This commit is contained in:
parent
2db85ca6ec
commit
59a6daa2fc
@ -188,7 +188,7 @@ inline int16_t tga_read_short() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
i = *(int16_t *)(Tga_file_data + Fake_pos);
|
||||
memcpy(&i, Tga_file_data + Fake_pos, sizeof(i));
|
||||
Fake_pos += 2;
|
||||
|
||||
return INTEL_SHORT(i);
|
||||
|
Loading…
Reference in New Issue
Block a user