From d1ea072c6f33564a84634165f54af743d4438ebf Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Fri, 22 Jun 2018 16:44:05 +0100 Subject: [PATCH] Fix fuzz targets --- common/src/lib.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/src/lib.rs b/common/src/lib.rs index eb3b83b..936d278 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -388,8 +388,7 @@ pub fn fuzz_obj_load(data: &[u8]) { use std::io::Cursor; let cursor = Cursor::new(data); - - let _: obj::Obj = obj::load_obj(cursor).unwrap(); + let _: Result = obj::load_obj(cursor); } #[inline(always)] @@ -398,9 +397,9 @@ pub fn fuzz_lewton_read(data: &[u8]) { let cursor = Cursor::new(data); - let mut reader = lewton::inside_ogg::OggStreamReader::new(cursor).unwrap(); - - while let Some(_) = reader.read_dec_packet().unwrap() {} + if let Ok(mut reader) = lewton::inside_ogg::OggStreamReader::new(cursor) { + while let Ok(Some(_)) = reader.read_dec_packet() {} + } } #[inline(always)]