===Bugfix===

matrix.resize4x4() was incorrectly allocating a array of pointers using
the wrong cast -- sizeof(float) instead of sizeof(float *).  Worked fine
on 32-bit systems but caused a crash on AMD64.  Discovered by a student
in one of my classes (kudos, Joe).
This commit is contained in:
Ken Hughes
2006-04-24 23:00:03 +00:00
parent 9e7a0e1987
commit 5fa5ea352e

View File

@@ -113,7 +113,7 @@ PyObject *Matrix_Resize4x4(MatrixObject * self)
"matrix.resize4x4(): problem allocating pointer space\n\n");
}
self->contigPtr = self->data.py_data; //force
self->matrix = PyMem_Realloc(self->matrix, (sizeof(float) * 4));
self->matrix = PyMem_Realloc(self->matrix, (sizeof(float *) * 4));
if(self->matrix == NULL) {
return EXPP_ReturnPyObjError(PyExc_MemoryError,
"matrix.resize4x4(): problem allocating pointer space\n\n");