mirror of
https://github.com/godotengine/godot.git
synced 2024-11-22 12:12:28 +00:00
Fix a crash when trying to load a WebP StreamTexture2D
This commit is contained in:
parent
4a3430bd27
commit
0ab661de63
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user