From 135711883420b4209e08dd91c7cf3ecaa60708ee Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Sat, 11 Jul 2015 00:27:49 -0700 Subject: [PATCH] Fix segfault on Windows --- src/_path_wrapper.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_path_wrapper.cpp b/src/_path_wrapper.cpp index b6438a90242c..a62893077c86 100644 --- a/src/_path_wrapper.cpp +++ b/src/_path_wrapper.cpp @@ -355,7 +355,9 @@ static PyObject *Py_point_in_path_collection(PyObject *self, PyObject *args, PyO npy_intp dims[] = {(npy_intp)result.size() }; numpy::array_view pyresult(dims); - memcpy(pyresult.data(), &result[0], result.size() * sizeof(int)); + if (result.size() > 0) { + memcpy(pyresult.data(), &result[0], result.size() * sizeof(int)); + } return pyresult.pyobj(); }