From aa71626dd00d56cc83a9a5e869d9da561683a88c Mon Sep 17 00:00:00 2001 From: Christoph Gohlke Date: Sat, 13 Jul 2013 18:17:14 -0700 Subject: [PATCH] Allocate enough memory to hold pointers --- encode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encode.c b/encode.c index d264ad914..783e67a8e 100644 --- a/encode.c +++ b/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();