Fix T88345: Blender crash on GPUFrameBuffer creation

Misuse of indexes.

`color_attachements` has only color ones while `config` has color and depth.
This commit is contained in:
Germano Cavalcante 2021-05-18 09:39:31 -03:00
parent 4402c3006b
commit ea7b00c64f
Notes: blender-bot 2023-02-14 05:52:32 +01:00
Referenced by issue #88345, Blender crash on GPUFrameBuffer creation
1 changed files with 2 additions and 2 deletions

View File

@ -323,9 +323,9 @@ static PyObject *pygpu_framebuffer__tp_new(PyTypeObject *UNUSED(self),
return NULL;
}
for (int i = 1; i <= color_attachements_len; i++) {
for (int i = 0; i < color_attachements_len; i++) {
PyObject *o = PySequence_GetItem(color_attachements, i);
bool ok = pygpu_framebuffer_new_parse_arg(o, &config[i]);
bool ok = pygpu_framebuffer_new_parse_arg(o, &config[i + 1]);
Py_DECREF(o);
if (!ok) {
return NULL;