Merge branch 'master' into 'master'

Fix segmentation faults on 32-bit ARM devices running GNU/Linux

See merge request KartKrew/Kart-Public!332
This commit is contained in:
Sal 2024-03-29 21:51:49 +00:00
commit 62294dfe35

View file

@ -242,7 +242,7 @@ void *Z_Malloc2(size_t size, INT32 tag, void *user, INT32 alignbits,
void *Z_MallocAlign(size_t size, INT32 tag, void *user, INT32 alignbits)
#endif
{
size_t extrabytes = (1<<alignbits) - 1;
size_t extrabytes = (1<<alignbits) - (sizeof(size_t)*8 > (UINT32) alignbits); // only subtract 1 if the bit shift did not cause an overflow
size_t padsize = 0;
memblock_t *block;
void *ptr;