Fix (unreported) light cache bake crash

missing NULL check if there is no cache there to begin with.

Differential Revision: https://developer.blender.org/D10581
This commit is contained in:
Philipp Oeser
2021-03-02 17:46:15 +01:00
parent 9c604ab0ca
commit 3d7a00b8aa

View File

@@ -313,11 +313,14 @@ static bool EEVEE_lightcache_validate(const LightCache *light_cache,
const int grid_len,
const int irr_size[3])
{
if (light_cache == NULL) {
return false;
}
if (!eevee_lightcache_version_check(light_cache)) {
return false;
}
if (light_cache && !(light_cache->flag & LIGHTCACHE_INVALID)) {
if (!(light_cache->flag & LIGHTCACHE_INVALID)) {
/* See if we need the same amount of texture space. */
if ((irr_size[0] == light_cache->grid_tx.tex_size[0]) &&
(irr_size[1] == light_cache->grid_tx.tex_size[1]) &&