From b74bc42a4304be631936ad7fac5d1605a93ab759 Mon Sep 17 00:00:00 2001 From: "K. S. Ernest (iFire) Lee" Date: Wed, 16 Jun 2021 16:13:36 -0700 Subject: [PATCH] ERR_FAIL_NULL check file access Null in ResourceImporterTexture::_save_stex --- editor/import/resource_importer_texture.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 809f47bad98..72df65a7876 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -308,6 +308,7 @@ void ResourceImporterTexture::save_to_stex_format(FileAccess *f, const Ref &p_image, const String &p_to_path, CompressMode p_compress_mode, float p_lossy_quality, Image::CompressMode p_vram_compression, bool p_mipmaps, bool p_streamable, bool p_detect_3d, bool p_detect_roughness, bool p_detect_normal, bool p_force_normal, bool p_srgb_friendly, bool p_force_po2_for_compressed, uint32_t p_limit_mipmap, const Ref &p_normal, Image::RoughnessChannel p_roughness_channel) { FileAccess *f = FileAccess::open(p_to_path, FileAccess::WRITE); + ERR_FAIL_NULL(f); f->store_8('G'); f->store_8('S'); f->store_8('T');