mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 01:16:16 +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.");
|
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