From c603ab33d1d7d4c82074ff8da8fe520c5c8b87cf Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Mon, 29 Jul 2024 15:41:44 -0700 Subject: [PATCH] Initialize length of numpy array correctly. Issue: #6 --- python/G722_mod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/G722_mod.c b/python/G722_mod.c index 10f969e..0d8d3cb 100644 --- a/python/G722_mod.c +++ b/python/G722_mod.c @@ -217,7 +217,7 @@ PyG722_decode(PyG722* self, PyObject* args) { owner->data = array; // Create a new numpy array to hold the integers - long dims[1] = {olength}; + npy_intp dims[1] = {olength}; PyObject* numpy_array = PyArray_SimpleNewFromData(1, dims, NPY_INT16, (void *)array); if (numpy_array == NULL) goto e1; PyArray_SetBaseObject((PyArrayObject*)numpy_array, (PyObject*)owner);