Merge pull request #49520 from pfertyk/issue-46278-empty-texture-crashes-godot

Validate texture in RendererStorageRD::free
This commit is contained in:
Rémi Verschelde 2021-06-12 22:27:14 +02:00 committed by GitHub
commit 2787ee634a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)) {