diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-03-02 19:46:15 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-03-02 19:54:45 +0300 |
commit | 3d7a00b8aa174069cf622952dbddda6201fbf653 (patch) | |
tree | 316e00e462e362b66473297a07bd15c2cd22548b /source/blender/draw/engines/eevee/eevee_lightcache.c | |
parent | 9c604ab0ca4d6f0264b3c253526827c72276ffe8 (diff) |
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
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lightcache.c')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_lightcache.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index c2bd0d2b971..37ecdb20651 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -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]) && |