Check return value of SDL_small_alloc()

Fixes https://github.com/libsdl-org/SDL/issues/8959
This commit is contained in:
Sam Lantinga 2024-10-13 13:17:03 -07:00
parent d7be7fc168
commit 1cc85c912b
9 changed files with 22 additions and 55 deletions

View file

@ -3578,8 +3578,7 @@ bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count
bool isstack1;
bool isstack2;
float *xy = SDL_small_alloc(float, 4 * 2 * count, &isstack1);
int *indices = SDL_small_alloc(int,
(4) * 3 * (count - 1) + (2) * 3 * (count), &isstack2);
int *indices = SDL_small_alloc(int, (4) * 3 * (count - 1) + (2) * 3 * (count), &isstack2);
if (xy && indices) {
int i;