Added a sanity check to the PGC code.

This commit is contained in:
OBattler
2020-01-15 02:34:50 +01:00
parent 05515187ee
commit 772a628278

View File

@@ -862,7 +862,8 @@ pgc_fill_polygon(pgc_t *dev, unsigned corners, int32_t *x, int32_t *y)
pgc_log("PGC: fill_polygon(%i corners)\n", corners);
if (corners < 2) return; /* Degenerate polygon */
if (!x || !y || (corners < 2))
return; /* Degenerate polygon */
nodex = (double *)malloc(corners * sizeof(double));
dx = (double *)malloc(corners * sizeof(double));