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:
authorCampbell Barton <ideasman42@gmail.com>2019-10-14 10:37:31 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-10-14 10:39:16 +0300
commite8220dea606d0db5fa554e83ff969de19b95a6e9 (patch)
treed2a442e1d10db9d59ba009298719256767334e8e /source/blender
parent95f020c853d6f1c6afc46cd3b3c0f6b8817a1245 (diff)
GPU: prevent assert for zero length arrays
This could happen with the build modifier.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/gpu/intern/gpu_element.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_element.c b/source/blender/gpu/intern/gpu_element.c
index 166a6236893..518829d1c78 100644
--- a/source/blender/gpu/intern/gpu_element.c
+++ b/source/blender/gpu/intern/gpu_element.c
@@ -243,7 +243,7 @@ GPUIndexBuf *GPU_indexbuf_create_subrange(GPUIndexBuf *elem_src, uint start, uin
{
GPUIndexBuf *elem = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf");
BLI_assert(elem_src && !elem_src->is_subrange);
- BLI_assert(start + length <= elem_src->index_len);
+ BLI_assert((length == 0) || (start + length <= elem_src->index_len));
#if GPU_TRACK_INDEX_RANGE
elem->index_type = elem_src->index_type;
elem->gl_index_type = elem_src->gl_index_type;