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:
authorClément Foucault <foucault.clem@gmail.com>2020-08-18 14:53:00 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-08-18 14:53:07 +0300
commit41235eed1dad40abf7a34750beedff1176e0c6e5 (patch)
treefc7bd480017dfd95a8c4a8a74785f040e469b17d /source/blender/gpu/opengl/gl_batch.cc
parentfe1827df821cdba2d66b03c0f3366e8df3c2fe76 (diff)
GPU: Avoid invalid GL API usage
Drawing with 0 sized buffer is prohibited.
Diffstat (limited to 'source/blender/gpu/opengl/gl_batch.cc')
-rw-r--r--source/blender/gpu/opengl/gl_batch.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_batch.cc b/source/blender/gpu/opengl/gl_batch.cc
index 00e1a61f7cf..38448e8a0b8 100644
--- a/source/blender/gpu/opengl/gl_batch.cc
+++ b/source/blender/gpu/opengl/gl_batch.cc
@@ -325,6 +325,8 @@ void GLBatch::draw(int v_first, int v_count, int i_first, int i_count)
{
this->bind(i_first);
+ BLI_assert(v_count > 0 && i_count > 0);
+
GLenum gl_type = convert_prim_type_to_gl(prim_type);
if (elem) {