From 0ab661de6316bf1fc8578982d354daf74d3919d8 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 29 Jul 2021 16:05:03 +0300 Subject: Fix a crash when trying to load a WebP StreamTexture2D --- scene/resources/texture.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scene/resources') diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 38042d84fd..2ea55843ad 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -354,11 +354,11 @@ Ref StreamTexture2D::load_image_from_file(FileAccess *f, int p_size_limit } Ref img; - if (data_format == DATA_FORMAT_BASIS_UNIVERSAL) { + if (data_format == DATA_FORMAT_BASIS_UNIVERSAL && Image::basis_universal_unpacker) { img = Image::basis_universal_unpacker(pv); - } else if (data_format == DATA_FORMAT_PNG) { + } else if (data_format == DATA_FORMAT_PNG && Image::png_unpacker) { img = Image::png_unpacker(pv); - } else { + } else if (data_format == DATA_FORMAT_WEBP && Image::webp_unpacker) { img = Image::webp_unpacker(pv); } -- cgit v1.2.3