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>2018-12-22 22:17:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-01-11 18:00:23 +0300
commitbda2cd8ba5d14a39aef1927d168f2817d20bbaa8 (patch)
tree34802f4fb25410e700aba742175e625423601b34 /source/blender/draw/modes
parentcca35c10135290f1a7e298d51964eef2c6c67ce0 (diff)
DRW: Fix texture paint crashing if object has no material slot
Diffstat (limited to 'source/blender/draw/modes')
-rw-r--r--source/blender/draw/modes/paint_texture_mode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/modes/paint_texture_mode.c b/source/blender/draw/modes/paint_texture_mode.c
index a89616c2cae..200daf66c83 100644
--- a/source/blender/draw/modes/paint_texture_mode.c
+++ b/source/blender/draw/modes/paint_texture_mode.c
@@ -282,7 +282,7 @@ static void PAINT_TEXTURE_cache_populate(void *vedata, Object *ob)
for (int i = 0; i < mat_nr; i++) {
const int index = use_material_slots ? i : 0;
- if (stl->g_data->shgroup_image_array[index]) {
+ if ((i < me->totcol) && stl->g_data->shgroup_image_array[index]) {
DRW_shgroup_call_add(stl->g_data->shgroup_image_array[index], geom_array[i], ob->obmat);
}
else {