From 8a1097a2243a9829d5d7e61ef10133f8096aa5e2 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 2 Jun 2017 22:08:41 -0300 Subject: many fixes to image loader, voxel cone tracing, etc. --- scene/resources/texture.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scene/resources') diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index bc8deb501e..68a11b821d 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -494,9 +494,9 @@ Error StreamTexture::_load_data(const String &p_path, int &tw, int &th, int &fla img = Image::lossy_unpacker(pv); } - if (img.is_null()) { + if (img.is_null() || img->empty()) { memdelete(f); - ERR_FAIL_COND_V(img->empty(), ERR_FILE_CORRUPT); + ERR_FAIL_COND_V(img.is_null() || img->empty(), ERR_FILE_CORRUPT); } total_size += img->get_data().size(); -- cgit v1.2.3