render: add NULL alloc check to dpoly()

This commit is contained in:
Lephe 2024-04-26 18:56:01 +02:00
parent 789ba7caa5
commit 5626713f40
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -10,6 +10,8 @@ static int compare(void const *ptr1, void const *ptr2)
static void dpoly_fill(int const *x, int const *y, int N, int color) static void dpoly_fill(int const *x, int const *y, int N, int color)
{ {
int *nodeX = malloc(N * sizeof *nodeX); int *nodeX = malloc(N * sizeof *nodeX);
if(!nodeX)
return;
/* Find vertical bounds */ /* Find vertical bounds */
int ymin = y[0], ymax = y[0]; int ymin = y[0], ymax = y[0];