image-rs / image-png

PNG decoding and encoding library in pure Rust
https://docs.rs/png
Apache License 2.0
347 stars 139 forks source link

Regression test for invalid CRC ancillary chunks #435

Closed sophie-h closed 7 months ago

sophie-h commented 7 months ago

Issue #430

Not sure how to test for failure with checks enabled.

cc @anforowicz

anforowicz commented 7 months ago

Thanks - this is great!

Not sure how to test for failure with checks enabled.

You could add a #[test] in src/decoder/mod.rs which include_bytes!("../../tests/bugfixes/issue#430.png") and then in the test configure the non-default options for the decoder + check that the expected result gets returned. It seems a lower priority though, so it's probably fine to postpone it or do it in a separate PR.