Solve another case of invalid indices.

This commit is contained in:
Antony Riakiotakis
2014-08-28 23:26:52 +02:00
parent d1c9101642
commit f823ea1ac4

View File

@@ -1393,9 +1393,16 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma)
}
}
}
else {
ma->paint_active_slot = 0;
ma->paint_clone_slot = 0;
return;
}
ma->tot_slots = count;
if (ma->paint_active_slot >= count) {
ma->paint_active_slot = count - 1;
}