Commit: e5487a81a414e0564a977f442e690f38d9ae4ebf
Author: Jacques Lucke
Date:   Mon Mar 21 10:05:39 2022 +0100
Branches: blender-v3.1-release
https://developer.blender.org/rBe5487a81a414e0564a977f442e690f38d9ae4ebf

Fix T96572: eevee crash with motion blur and stereoscopy

This was a use-after-free bug due to dangling pointers.

===================================================================

M       source/blender/draw/engines/eevee/eevee_data.c

===================================================================

diff --git a/source/blender/draw/engines/eevee/eevee_data.c 
b/source/blender/draw/engines/eevee/eevee_data.c
index 58ea682c060..ab96e2a446f 100644
--- a/source/blender/draw/engines/eevee/eevee_data.c
+++ b/source/blender/draw/engines/eevee/eevee_data.c
@@ -119,10 +119,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;
     }
   }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to