Skip to content

Commit

Permalink
Make sure and account for offset in test of whether or not an array c…
Browse files Browse the repository at this point in the history
…an be created from the available buffer.
  • Loading branch information
teoliphant committed Jan 14, 2010
1 parent 5efba97 commit 5aa1223
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion numpy/core/src/multiarray/arrayobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ array_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds)
dims.ptr[0] = (buffer.len-(intp)offset) / itemsize;
}
else if ((strides.ptr == NULL) &&
(buffer.len < ((intp)itemsize)*
(buffer.len < (offset + (intp)itemsize)*
PyArray_MultiplyList(dims.ptr, dims.len))) {
PyErr_SetString(PyExc_TypeError,
"buffer is too small for " \
Expand Down

0 comments on commit 5aa1223

Please sign in to comment.