From 31cd42373b0dae78aadfa1ab8896f8b064205aee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Fertyk?= Date: Fri, 11 Jun 2021 20:12:23 +0200 Subject: [PATCH] Validate texture in RendererStorageRD::free --- servers/rendering/renderer_rd/renderer_storage_rd.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp index 05993829d1d..4f96defc0f3 100644 --- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp @@ -8552,6 +8552,7 @@ bool RendererStorageRD::free(RID p_rid) { if (texture_owner.owns(p_rid)) { Texture *t = texture_owner.getornull(p_rid); + ERR_FAIL_COND_V(!t, false); ERR_FAIL_COND_V(t->is_render_target, false); if (RD::get_singleton()->texture_is_valid(t->rd_texture_srgb)) {