Fixed a bug in the array indexing that was causing heap corruption

This commit is contained in:
Neil Brown 2007-07-31 21:58:34 +00:00
parent 432d406f26
commit 7d7f66c626

View File

@ -233,7 +233,7 @@ public:
inline tockArrayView<T,DIMS - 1> operator[] (const unsigned index) const
{
return tockArrayView<T,DIMS - 1>(realArray + (totalSubDim * index),dims,totalSubDim / dims[0]);
return tockArrayView<T,DIMS - 1>(realArray + (totalSubDim * index),dims,DIMS <= 1 ? 1 : (totalSubDim / dims[1]));
}
inline tockArrayView<T,DIMS> sliceFor(const unsigned amount) const