From 5626713f40cc3a9dd0773859a0766a072418cde8 Mon Sep 17 00:00:00 2001 From: Lephe Date: Fri, 26 Apr 2024 18:56:01 +0200 Subject: [PATCH] render: add NULL alloc check to dpoly() --- src/render/dpoly.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/render/dpoly.c b/src/render/dpoly.c index 43bf79d..0f84cb9 100644 --- a/src/render/dpoly.c +++ b/src/render/dpoly.c @@ -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) { int *nodeX = malloc(N * sizeof *nodeX); + if(!nodeX) + return; /* Find vertical bounds */ int ymin = y[0], ymax = y[0];