mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Merge pull request #5108 from cgohlke/patch-1
Fix dereferencing potential null pointer
This commit is contained in:
commit
0eddc82157
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue
Block a user