Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3829741

Browse files
committed
Merge pull request matplotlib#4624 from cgohlke/patch-2
Fix segfault on Windows
2 parents 14d8904 + 1357118 commit 3829741

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/_path_wrapper.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ static PyObject *Py_point_in_path_collection(PyObject *self, PyObject *args, PyO
355355

356356
npy_intp dims[] = {(npy_intp)result.size() };
357357
numpy::array_view<int, 1> pyresult(dims);
358-
memcpy(pyresult.data(), &result[0], result.size() * sizeof(int));
358+
if (result.size() > 0) {
359+
memcpy(pyresult.data(), &result[0], result.size() * sizeof(int));
360+
}
359361
return pyresult.pyobj();
360362
}
361363

0 commit comments

Comments
 (0)