Fixed undefined behavior in SDL_memset() (thanks andrewrk!)

Fixes https://github.com/libsdl-org/SDL/issues/5147
This commit is contained in:
Sam Lantinga 2021-12-28 15:58:15 -08:00
parent 6a7b63802c
commit ab6d0d4d50
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len)
}
}
value4 = (c | (c << 8) | (c << 16) | (c << 24));
value4 = ((Uint32)c | ((Uint32)c << 8) | ((Uint32)c << 16) | ((Uint32)c << 24));
dstp4 = (Uint32 *) dstp1;
left = (len % 4);
len /= 4;