Allocate enough memory to hold pointers

This commit is contained in:
Christoph Gohlke 2013-07-13 18:17:14 -07:00
parent 2798914be2
commit aa71626dd0

View File

@ -534,7 +534,7 @@ static unsigned int** get_qtables_arrays(PyObject* qtables) {
PyErr_SetString(PyExc_ValueError, "Not a valid numbers of quantization tables. Should be between 2 and 4."); PyErr_SetString(PyExc_ValueError, "Not a valid numbers of quantization tables. Should be between 2 and 4.");
return NULL; return NULL;
} }
qarrays = (unsigned int**) PyMem_Malloc(num_tables * sizeof(unsigned int)); qarrays = (unsigned int**) PyMem_Malloc(num_tables * sizeof(unsigned int*));
if (!qarrays) { if (!qarrays) {
Py_DECREF(tables); Py_DECREF(tables);
PyErr_NoMemory(); PyErr_NoMemory();