Commit d2c8d442 authored by Kurt Smith's avatar Kurt Smith Committed by Mark Florisson

fix in BufferCopyContents code.

parent c94c6153
...@@ -650,6 +650,7 @@ static int __Pyx_ValidateAndInit_memviewslice( ...@@ -650,6 +650,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
for(i=0; i<ndim; i++) { for(i=0; i<ndim; i++) {
spec = axes_specs[i]; spec = axes_specs[i];
if (spec & __Pyx_MEMVIEW_CONTIG) { if (spec & __Pyx_MEMVIEW_CONTIG) {
if (buf->strides[i] != buf->itemsize) { if (buf->strides[i] != buf->itemsize) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
...@@ -659,7 +660,7 @@ static int __Pyx_ValidateAndInit_memviewslice( ...@@ -659,7 +660,7 @@ static int __Pyx_ValidateAndInit_memviewslice(
} }
if (spec & (__Pyx_MEMVIEW_STRIDED | __Pyx_MEMVIEW_FOLLOW)) { if (spec & (__Pyx_MEMVIEW_STRIDED | __Pyx_MEMVIEW_FOLLOW)) {
if (buf->strides[i] <= buf->itemsize) { if (buf->strides[i] < buf->itemsize) {
PyErr_SetString(PyExc_ValueError, PyErr_SetString(PyExc_ValueError,
"Buffer and memoryview are not contiguous in the same dimension."); "Buffer and memoryview are not contiguous in the same dimension.");
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment