Fix T79737: ERROR ACCESS VIOLATION when switching to eevee rendered view

This prevents Blender from crashing when switching
to rendered view and the grid_data is NULL in the
lightcache (due to possible corruption), by switching
to the fallback lightcache. The fix extends the solution
for possible corruption in the cube_data as well.

Fix T79737

Reviewed By: fclem
Differential Revision: https://developer.blender.org/D8835
This commit is contained in:
Aristotelis Dossas 2020-09-10 14:31:17 +02:00 committed by Clément Foucault
parent 8d59f060ca
commit 4a82d792b0
Notes: blender-bot 2023-02-14 04:31:04 +01:00
Referenced by issue #79737, ERROR ACCESS VIOLATION when switching to evee rendered view
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 2 additions and 2 deletions

View File

@ -388,8 +388,8 @@ LightCache *EEVEE_lightcache_create(const int grid_len,
static bool eevee_lightcache_static_load(LightCache *lcache)
{
/* We use fallback if a texture is not setup and there is no data to restore it. */
if ((!lcache->grid_tx.tex && !lcache->grid_tx.data) ||
(!lcache->cube_tx.tex && !lcache->cube_tx.data)) {
if ((!lcache->grid_tx.tex && !lcache->grid_tx.data) || !lcache->grid_data ||
(!lcache->cube_tx.tex && !lcache->cube_tx.data) || !lcache->cube_data) {
return false;
}
/* If cache is too big for this GPU. */