summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2021-07-29 16:05:03 +0300
committerYuri Sizov <yuris@humnom.net>2021-07-29 16:05:03 +0300
commit0ab661de6316bf1fc8578982d354daf74d3919d8 (patch)
treee2f0bdf92d7c5663782cf3ae74fe5328551c78de /scene/resources
parent4a3430bd27ca4be5e9dd9cb5997f6894e9acbefd (diff)
Fix a crash when trying to load a WebP StreamTexture2D
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/texture.cpp6
1 files changed, 3 insertions, 3 deletions
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<Image> StreamTexture2D::load_image_from_file(FileAccess *f, int p_size_limit
}
Ref<Image> 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);
}