mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Allocate enough memory to hold pointers
This commit is contained in:
parent
2798914be2
commit
aa71626dd0
2
encode.c
2
encode.c
|
@ -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();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user