Hi all,
I have been making a C extension to Python recently. This extension has a function that takes a 3D array (as made by pygame.surfarra y.pixels3d), is going to do operations on this array, and then return it.
My problem is, that the most basic form of this function is throwing a segmentation fault after 58 calls from my program. The input is always a 3D array of integers, 1st dimension of size 70, second of size 36, third of size 3. I have ran a test where each input is identical in every way, but the function still faults.
Here is the code:
Is there some memory management I am failing to do?
Thanks for any help!
~Tale
I have been making a C extension to Python recently. This extension has a function that takes a 3D array (as made by pygame.surfarra y.pixels3d), is going to do operations on this array, and then return it.
My problem is, that the most basic form of this function is throwing a segmentation fault after 58 calls from my program. The input is always a 3D array of integers, 1st dimension of size 70, second of size 36, third of size 3. I have ran a test where each input is identical in every way, but the function still faults.
Here is the code:
Code:
static PyObject *
TileTransform_getTransformedTile(TileTransform *self, PyObject *args)
{
PyObject *source;
//Parse the input parameters.
if (! PyArg_ParseTuple(args, "O", &source))
return NULL;
return source;
}
Thanks for any help!
~Tale
Comment