Skip to content

Commit

Permalink
Merge pull request #5108 from cgohlke/patch-1
Browse files Browse the repository at this point in the history
Fix dereferencing potential null pointer
  • Loading branch information
radarhere committed Dec 21, 2020
2 parents 9443997 + d1e706d commit 0eddc82
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/_imaging.c
Expand Up @@ -3179,6 +3179,10 @@ _draw_polygon(ImagingDrawObject* self, PyObject* args)

/* Copy list of vertices to array */
ixy = (int*) calloc(n, 2 * sizeof(int));
if (ixy == NULL) {
free(xy);
return ImagingError_MemoryError();
}

for (i = 0; i < n; i++) {
ixy[i+i] = (int) xy[i+i];
Expand Down

0 comments on commit 0eddc82

Please sign in to comment.