summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/iterators.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index 17c47a353..455ce06ad 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -1827,6 +1827,10 @@ PyArray_NeighborhoodIterNew(PyArrayIterObject *x, intp *bounds,
}
ret->mode = mode->mode;
break;
+ case NPY_NEIGHBORHOOD_ITER_MIRROR_PADDING:
+ ret->mode = mode->mode;
+ ret->constant = NULL;
+ break;
default:
PyErr_SetString(PyExc_ValueError, "Unsupported padding mode");
goto clean_x;
@@ -1857,7 +1861,9 @@ static void neighiter_dealloc(PyArrayNeighborhoodIterObject* iter)
Py_DECREF(*(PyObject**)iter->constant);
}
}
- PyDataMem_FREE(iter->constant);
+ if (iter->constant != NULL) {
+ PyDataMem_FREE(iter->constant);
+ }
Py_DECREF(iter->_internal_iter);
array_iter_base_dealloc((PyArrayIterObject*)iter);