Eevee: Fix T52546 : 129th light crashes Blender

This commit is contained in:
2017-09-12 13:13:20 +02:00
parent 74eed8e30e
commit 7a6f9ab587

View File

@@ -227,9 +227,9 @@ void EEVEE_lights_cache_add(EEVEE_SceneLayerData *sldata, Object *ob)
EEVEE_LampsInfo *linfo = sldata->lamps;
/* Step 1 find all lamps in the scene and setup them */
if (linfo->num_light > MAX_LIGHT) {
if (linfo->num_light >= MAX_LIGHT) {
printf("Too much lamps in the scene !!!\n");
linfo->num_light = MAX_LIGHT;
linfo->num_light = MAX_LIGHT - 1;
}
else {
Lamp *la = (Lamp *)ob->data;