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:
2021-05-18 09:39:31 -03:00
parent 4402c3006b
commit ea7b00c64f

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;