diff --git a/src/rtextures.c b/src/rtextures.c index a6741ee2a..8dc49fac5 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -3793,8 +3793,11 @@ void UnloadRenderTexture(RenderTexture2D target) { if (target.id > 0) { - // Color texture attached to FBO is deleted - rlUnloadTexture(target.texture.id); + if (target.texture.id > 0) + { + // Color texture attached to FBO is deleted + rlUnloadTexture(target.texture.id); + } // NOTE: Depth texture/renderbuffer is automatically // queried and deleted before deleting framebuffer