[Bf-blender-cvs] [4bb2a5b5cb7] blender-v2.93-release: Fix T88345: Blender crash on GPUFrameBuffer creation

Germano Cavalcante noreply at git.blender.org
Thu May 20 16:23:33 CEST 2021


Commit: 4bb2a5b5cb700d4564603f882c750eca5544bde6
Author: Germano Cavalcante
Date:   Tue May 18 09:39:31 2021 -0300
Branches: blender-v2.93-release
https://developer.blender.org/rB4bb2a5b5cb700d4564603f882c750eca5544bde6

Fix T88345: Blender crash on GPUFrameBuffer creation

Misuse of indexes.

`color_attachements` has only color ones while `config` has color and depth.

===================================================================

M	source/blender/python/gpu/gpu_py_framebuffer.c

===================================================================

diff --git a/source/blender/python/gpu/gpu_py_framebuffer.c b/source/blender/python/gpu/gpu_py_framebuffer.c
index bc393aaafa4..77eb4a37624 100644
--- a/source/blender/python/gpu/gpu_py_framebuffer.c
+++ b/source/blender/python/gpu/gpu_py_framebuffer.c
@@ -316,9 +316,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;



More information about the Bf-blender-cvs mailing list