You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use image::ColorType;fnmain(){letmut out = Vec::with_capacity(51200);letmut encoder = image::bmp::BMPEncoder::new(&mut out);
encoder.encode(&[1],1,1,ColorType::L8).unwrap();println!("out len: {}", out.len());}
Command: cargo run --release
Output on an ARM SBC (aarch64-unknown-linux-gnu): out len: 1082
On both my Windows 10 machines it fails due to memory allocation error (25GB on one, 100GB on the other).
I'm not entirely sure this is a bug in image rather than Rust itself; I first noticed this when a project suddenly began failing on 1.45 but worked fine on 1.44.1. While the above minimized code fails on both 1.45 and 1.44.1, it succeeds on other versions:
Rust version
Works?
1.45 (LLVM 10.0)
No
1.44.1
No
1.43.1
Yes (?!)
1.42.0
No
1.41.1
No
1.40.0
No
1.39.0
No
1.38.0 (LLVM 9.0)
No
1.37.0
Yes
1.36.0
Yes
1.35.0
Yes
1.34.0
Yes
The text was updated successfully, but these errors were encountered:
Expected
Encoding a 1-pixel BMP should take very little RAM.
Actual behaviour
Reproduction steps
Cargo.toml:
main.rs:
Command:
cargo run --release
Output on an ARM SBC (
aarch64-unknown-linux-gnu
):out len: 1082
On both my Windows 10 machines it fails due to memory allocation error (25GB on one, 100GB on the other).
I'm not entirely sure this is a bug in
image
rather than Rust itself; I first noticed this when a project suddenly began failing on 1.45 but worked fine on 1.44.1. While the above minimized code fails on both 1.45 and 1.44.1, it succeeds on other versions:The text was updated successfully, but these errors were encountered: