This commit is contained in:
Kovid Goyal 2024-01-19 13:29:12 +05:30
parent eb5dd364ae
commit 9503725a32
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -1048,7 +1048,7 @@ draw_borders(ssize_t vao_idx, unsigned int num_border_rects, BorderRect *rect_bu
static bool
attach_shaders(PyObject *sources, GLuint program_id, GLenum shader_type) {
RAII_ALLOC(const GLchar*, c_sources, calloc(sizeof(GLchar*), PyTuple_GET_SIZE(sources)));
RAII_ALLOC(const GLchar*, c_sources, calloc(PyTuple_GET_SIZE(sources), sizeof(GLchar*)));
for (Py_ssize_t i = 0; i < PyTuple_GET_SIZE(sources); i++) {
PyObject *temp = PyTuple_GET_ITEM(sources, i);
if (!PyUnicode_Check(temp)) { PyErr_SetString(PyExc_TypeError, "shaders must be strings"); return false; }