bevyengine / bevyengine/bevy

Some images compressed with `CompressedImageSaver` cause panics after loading

Open
#14,315 11 comments 0 reactions 0 assignees View on GitHub
A-Assets A-Rendering C-Bug I-Crash S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## Bevy version

0.14

## Relevant system information

```ignore
`AdapterInfo { name: "AMD Radeon RX 570 Series (RADV POLARIS10)", vendor: 4098, device: 26591, device_type: DiscreteGpu, driver: "radv", driver_info: "Mesa 24.1.3-arch1.1", backend: Vulkan }`
```

## What you did

Loaded a 50x50 white square made in GIMP preprocessed with `bevy_asset::processor::process::LoadAndSave`

## What went wrong

```
thread 'Compute Task Pool (3)' panicked at /home/seldom/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/util/device.rs:174:26:
range end index 3744 out of range for slice of length 3616
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Encountered a panic in system `bevy_render::render_asset::prepare_assets`!
```

## Additional information

Panic also occurred with a 49x50 white rectangle made in GIMP, a 64x33 textured image downloaded from itch.io, and some 50x50 icons downloaded from icons8.com. Panic didn't occur with a large variety of images including larger and smaller ones, and from a variety of sources. Panics seem to be more common with smaller images, but not strictly so.

Repro: https://github.com/Seldom-SE/testetst/blob/b70266e9f3779c4c4858a5a449cfe6b2b2d06278/src/main.rs

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.