From b5f03c9e74e83471a249f5ecf90cfca1dd359f5f Mon Sep 17 00:00:00 2001 From: Alexander Karpinsky Date: Tue, 4 Jan 2022 18:02:19 +0300 Subject: [PATCH] Two items, not two bytes --- src/_imaging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_imaging.c b/src/_imaging.c index 88af37f82..0b39e369b 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -761,7 +761,7 @@ _prepare_lut_table(PyObject *table, Py_ssize_t table_size) { } /* malloc check ok, max is 2 * 4 * 65**3 = 2197000 */ - prepared = (INT16 *)malloc(sizeof(INT16) * table_size + 2); + prepared = (INT16 *)malloc(sizeof(INT16) * (table_size + 2)); if (!prepared) { if (free_table_data) { free(table_data);