mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 01:04:29 +03:00
Fix dereferencing potential null pointer
This commit is contained in:
parent
c52c3ae3e2
commit
7673cb7549
|
@ -3180,6 +3180,10 @@ _draw_polygon(ImagingDrawObject* self, PyObject* args)
|
||||||
|
|
||||||
/* Copy list of vertices to array */
|
/* Copy list of vertices to array */
|
||||||
ixy = (int*) calloc(n, 2 * sizeof(int));
|
ixy = (int*) calloc(n, 2 * sizeof(int));
|
||||||
|
if (ixy == NULL) {
|
||||||
|
free(xy);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < n; i++) {
|
for (i = 0; i < n; i++) {
|
||||||
ixy[i+i] = (int) xy[i+i];
|
ixy[i+i] = (int) xy[i+i];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user