Skip to content

Commit

Permalink
Test failing image for skip_ancillary_crc disabled (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophie-h authored Dec 5, 2023
1 parent 7f70ffa commit 3f563bb
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/bugfixes.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use std::fs::File;

use png::{DecodeOptions, Decoder, DecodingError};

#[test]
fn issue_430() {
let file = File::open("tests/bugfixes/issue#430.png").unwrap();

let mut decode_options = DecodeOptions::default();
decode_options.set_skip_ancillary_crc_failures(false);

let decoder = Decoder::new_with_options(file, decode_options).read_info();

assert!(
matches!(decoder, Err(DecodingError::Format(_))),
"Decoding of iCCP chunk with invalid CRC should have failed with 'skip_ancillary_crc' disabled."
);
}

0 comments on commit 3f563bb

Please sign in to comment.