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
Notes: blender-bot 2023-02-14 11:00:17 +01:00
Referenced by issue #86042, EEVEE 2.93 incorrect irradiance bake
1 changed files with 4 additions and 1 deletions

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]) &&