diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-05-18 15:39:31 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-05-18 15:39:31 +0300 |
commit | ea7b00c64fcd3bcff4a4d1455e0ef334bdd6a6ec (patch) | |
tree | 846515537d9991ed8fce8f8af3881ef51fc8adaf /source/blender/python/gpu/gpu_py_framebuffer.c | |
parent | 4402c3006be5bac4debcc121047175db27476ec9 (diff) |
Fix T88345: Blender crash on GPUFrameBuffer creation
Misuse of indexes.
`color_attachements` has only color ones while `config` has color and depth.
Diffstat (limited to 'source/blender/python/gpu/gpu_py_framebuffer.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_framebuffer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/python/gpu/gpu_py_framebuffer.c b/source/blender/python/gpu/gpu_py_framebuffer.c index 7f64cb90a97..0efc0713538 100644 --- a/source/blender/python/gpu/gpu_py_framebuffer.c +++ b/source/blender/python/gpu/gpu_py_framebuffer.c @@ -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; |