mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-10 08:12:33 +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 */
|
/* 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 ImagingError_MemoryError();
|
||||||
|
}
|
||||||
|
|
||||||
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