mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-11 04:07:21 +03:00
Merge pull request #287 from cgohlke/patch-1
Allocate enough memory to hold pointers
This commit is contained in:
commit
1841fbacf3
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.");
|
||||
return NULL;
|
||||
}
|
||||
qarrays = (unsigned int**) PyMem_Malloc(num_tables * sizeof(unsigned int));
|
||||
qarrays = (unsigned int**) PyMem_Malloc(num_tables * sizeof(unsigned int*));
|
||||
if (!qarrays) {
|
||||
Py_DECREF(tables);
|
||||
PyErr_NoMemory();
|
||||
|
|
Loading…
Reference in New Issue
Block a user