From b44d47f582c79ac15fe1f8a70ec203ac776cd69a Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Tue, 6 Sep 2022 08:08:28 +0100 Subject: [PATCH] Fix GLES directional shadow uninitialized data Valgrind shows directional_shadow.fbo accessed when uninitialized in directional_shadow_create. (cherry picked from commit 9b294b298e3d8511e75e553882f159bf738931e6) --- drivers/gles2/rasterizer_scene_gles2.h | 12 ++++++------ drivers/gles3/rasterizer_scene_gles3.h | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gles2/rasterizer_scene_gles2.h b/drivers/gles2/rasterizer_scene_gles2.h index b3e0e8eddb5..ed541911280 100644 --- a/drivers/gles2/rasterizer_scene_gles2.h +++ b/drivers/gles2/rasterizer_scene_gles2.h @@ -288,13 +288,13 @@ public: bool shadow_atlas_update_light(RID p_atlas, RID p_light_intance, float p_coverage, uint64_t p_light_version); struct DirectionalShadow { - GLuint fbo; - GLuint depth; - GLuint color; + GLuint fbo = 0; + GLuint depth = 0; + GLuint color = 0; - int light_count; - int size; - int current_light; + int light_count = 0; + int size = 0; + int current_light = 0; } directional_shadow; virtual int get_directional_light_shadow_size(RID p_light_intance); diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 91f8d3b0f93..ecc38fd9f1c 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -278,11 +278,11 @@ public: bool shadow_atlas_update_light(RID p_atlas, RID p_light_intance, float p_coverage, uint64_t p_light_version); struct DirectionalShadow { - GLuint fbo; - GLuint depth; - int light_count; - int size; - int current_light; + GLuint fbo = 0; + GLuint depth = 0; + int light_count = 0; + int size = 0; + int current_light = 0; } directional_shadow; virtual int get_directional_light_shadow_size(RID p_light_intance);