Skip to content

Commit

Permalink
fix: don't try to parse textures with empty data
Browse files Browse the repository at this point in the history
  • Loading branch information
kuruk-mm committed Oct 28, 2024
1 parent 332b69b commit dff521b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/content/texture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))?;
Expand Down

0 comments on commit dff521b

Please sign in to comment.