mirror of https://github.com/libsdl-org/SDL.git
Fixed possible memset(NULL) call in testautomation's SDL_aligned_alloc() check
Fixes https://github.com/libsdl-org/SDL/issues/11144
This commit is contained in:
parent
4b7c5f561b
commit
8262072d91
|
|
@ -913,9 +913,11 @@ static int SDLCALL stdlib_aligned_alloc(void *arg)
|
|||
}
|
||||
SDLTest_AssertCheck(ptr != NULL, "Check output, expected non-NULL, got: %p", ptr);
|
||||
SDLTest_AssertCheck((((size_t)ptr) % alignment) == 0, "Check output, expected aligned pointer, actual offset: %"SIZE_FORMAT, (((size_t)ptr) % alignment));
|
||||
SDLTest_AssertPass("Filling memory to alignment value");
|
||||
SDL_memset(ptr, 0xAA, alignment);
|
||||
SDL_aligned_free(ptr);
|
||||
if (ptr != NULL) {
|
||||
SDLTest_AssertPass("Filling memory to alignment value");
|
||||
SDL_memset(ptr, 0xAA, alignment);
|
||||
SDL_aligned_free(ptr);
|
||||
}
|
||||
}
|
||||
|
||||
return TEST_COMPLETED;
|
||||
|
|
|
|||
Loading…
Reference in New Issue