Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <germano.costa@ig.com.br>2021-08-16 19:53:56 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-08-16 19:57:25 +0300
commit4dba2060118b43699a40ae04a66f75ba5f9c745e (patch)
treec6e8077a91887c452e3c125875a9b4883ff687e5 /source/blender/python/gpu/gpu_py_shader.c
parentb5117660da27d9d13c48c1d2f1afd64083e120bb (diff)
PyAPI: GPUShader: make 'uniform_vector_*' less restricted
Buffers larger than required may be allowed without restriction.
Diffstat (limited to 'source/blender/python/gpu/gpu_py_shader.c')
-rw-r--r--source/blender/python/gpu/gpu_py_shader.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c
index 41c40fdeb96..145586d8ab0 100644
--- a/source/blender/python/gpu/gpu_py_shader.c
+++ b/source/blender/python/gpu/gpu_py_shader.c
@@ -211,8 +211,9 @@ static bool pygpu_shader_uniform_vector_impl(PyObject *args,
return false;
}
- if (r_pybuffer->len != (*r_length * *r_count * elem_size)) {
- PyErr_SetString(PyExc_BufferError, "GPUShader.uniform_vector_*: buffer size does not match.");
+ if (r_pybuffer->len < (*r_length * *r_count * elem_size)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "GPUShader.uniform_vector_*: buffer size smaller than required.");
return false;
}