Skip to content

Commit 0b0b3f3

Browse files
committed
update png crate
> `Decoder::output_buffer_size` ... now return `Option<usize>` to reflect that these calculations no longer overflow on some targets where the required buffers can not be represented in the address space.
1 parent 03fcf1a commit 0b0b3f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ crc32fast = "1"
1616
deflate = "1"
1717
image = { version = "0.25", default-features = false, features = ["png"] }
1818
inflate = "0.4"
19-
png = "0.17.16"
19+
png = "0.18.0"
2020
thiserror = "2"

src/icon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ impl Icon {
221221
// notably does not convert greyscale color types to RGB.
222222
png_decoder.set_transformations(Transformations::EXPAND | Transformations::ALPHA);
223223
let mut png_reader = png_decoder.read_info()?;
224-
let mut rgba_buf = vec![0u8; png_reader.output_buffer_size()];
224+
let mut rgba_buf = vec![0u8; png_reader.output_buffer_size().unwrap_or_default()];
225225
let info = png_reader.next_frame(&mut rgba_buf)?;
226226

227227
// EXPAND and ALPHA do not expand grayscale images into RGBA. We can just do this manually.

0 commit comments

Comments
 (0)