Updated the image-png fuzzer. (#5457)

This commit is contained in:
DavidKorczynski 2021-03-21 02:45:29 +00:00 committed by GitHub
parent de52eac2b0
commit 9afd3b24a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 8 deletions

View File

@ -3,7 +3,6 @@ extern crate libfuzzer_sys;
use libfuzzer_sys::fuzz_target;
extern crate png;
use std::mem::discriminant;
use std::io::{BufRead, Read, Result};
/// A reader that reads at most `n` bytes.
@ -67,11 +66,9 @@ fn png_compare<R: BufRead, S: BufRead>(reference: png::Decoder<R>, smal: png::De
let mut ref_data = vec![0; info.buffer_size()];
let mut smal_data = vec![0; info.buffer_size()];
use png::DecodingError::*;
let _rref = reference.next_frame(&mut ref_data);
let _rsmal = smal.next_frame(&mut smal_data);
loop {
let rref = reference.next_frame(&mut ref_data);
let rsmal = smal.next_frame(&mut smal_data);
assert_eq!(smal_data, ref_data);
return Ok(info);
}
}