Fix T96572: eevee crash with motion blur and stereoscopy

This was a use-after-free bug due to dangling pointers.
This commit is contained in:
Jacques Lucke 2022-03-21 10:05:39 +01:00
parent fb87578698
commit 9ed63ebb45
Notes: blender-bot 2023-02-14 11:21:40 +01:00
Referenced by issue #96572, Stereoscopy with Motion Blur crashes in Eevee
Referenced by issue #96241, 3.1: Potential candidates for corrective releases
1 changed files with 2 additions and 0 deletions

View File

@ -104,10 +104,12 @@ void EEVEE_motion_blur_data_free(EEVEE_MotionBlurData *mb)
for (int i = 0; i < 2; i++) {
if (mb->position_vbo_cache[i]) {
BLI_ghash_free(mb->position_vbo_cache[i], NULL, (GHashValFreeFP)GPU_vertbuf_discard);
mb->position_vbo_cache[i] = NULL;
}
if (mb->hair_motion_step_cache[i]) {
BLI_ghash_free(
mb->hair_motion_step_cache[i], NULL, (GHashValFreeFP)EEVEE_motion_hair_step_free);
mb->hair_motion_step_cache[i] = NULL;
}
}
}