From dc7d9f8868f8e58ef6bfc5c3b4f417d3437331f0 Mon Sep 17 00:00:00 2001 From: Stanislav Date: Sat, 19 Jan 2019 16:48:43 +0300 Subject: [PATCH] Check for null pointer in RasterizerSceneGLES2::render_shadow Fixes #25131 --- drivers/gles2/rasterizer_scene_gles2.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index e4783e907be..075d7a4425d 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -3015,7 +3015,9 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_ } } - glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height); + if (storage->frame.current_rt) { + glViewport(0, 0, storage->frame.current_rt->width, storage->frame.current_rt->height); + } glColorMask(1, 1, 1, 1); }