From dff521bae7b2260ca278e40d58ac2006d7782768 Mon Sep 17 00:00:00 2001 From: "Mateo \"Kuruk\" Miccino" Date: Mon, 28 Oct 2024 08:55:44 -0300 Subject: [PATCH] fix: don't try to parse textures with empty data --- lib/src/content/texture.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/content/texture.rs b/lib/src/content/texture.rs index 7c1b58ee3..b5503a701 100644 --- a/lib/src/content/texture.rs +++ b/lib/src/content/texture.rs @@ -37,6 +37,10 @@ pub async fn load_image_texture( .await .map_err(anyhow::Error::msg)?; + if bytes_vec.len() == 0 { + return Err(anyhow::Error::msg("Empty texture data")); + } + let _thread_safe_check = GodotSingleThreadSafety::acquire_owned(&ctx) .await .ok_or(anyhow::Error::msg("Failed trying to get thread-safe check"))?;