-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from birktj/fix-bugs
Fix bugs, compiler warnings and add tests
- Loading branch information
Showing
83 changed files
with
161 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file added
BIN
+71.6 KB
tests/fuzz_images/inf_loop/id:000029,src:000556+000125,op:splice,rep:64
Binary file not shown.
Binary file added
BIN
+64.8 KB
tests/fuzz_images/inf_loop/id:000030,src:000556+000125,op:splice,rep:128
Binary file not shown.
Binary file added
BIN
+3.15 KB
tests/fuzz_images/inf_loop/id:000031,src:000527+000541,op:splice,rep:8
Binary file not shown.
Binary file added
BIN
+99.1 KB
tests/fuzz_images/inf_loop/id:000032,src:000558+000248,op:splice,rep:8
Binary file not shown.
Binary file added
BIN
+69.5 KB
tests/fuzz_images/inf_loop/id:000033,src:000525+000106,op:splice,rep:4
Binary file not shown.
Binary file added
BIN
+57.9 KB
tests/fuzz_images/inf_loop/id:000034,src:000560+000475,op:splice,rep:128
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+48.9 KB
tests/fuzz_images/inf_loop/id:000040,src:000679+000165,op:splice,rep:4
Binary file not shown.
Binary file added
BIN
+69.5 KB
tests/fuzz_images/inf_loop/id:000041,src:000698+000155,op:splice,rep:8
Binary file not shown.
Binary file added
BIN
+71.8 KB
tests/fuzz_images/inf_loop/id:000042,src:000698+000155,op:splice,rep:64
Binary file not shown.
Binary file added
BIN
+93.8 KB
tests/fuzz_images/inf_loop/id:000043,src:000698+000155,op:splice,rep:128
Binary file not shown.
Binary file added
BIN
+69.4 KB
tests/fuzz_images/inf_loop/id:000044,src:000698+000155,op:splice,rep:2
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000000,sig:06,src:000000,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+181 Bytes
tests/fuzz_images/oom_crash/id:000001,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+154 Bytes
tests/fuzz_images/oom_crash/id:000002,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000003,sig:06,src:000000,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000004,sig:06,src:000000,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000005,sig:06,src:000000,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+196 Bytes
tests/fuzz_images/oom_crash/id:000006,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+174 Bytes
tests/fuzz_images/oom_crash/id:000007,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+217 Bytes
tests/fuzz_images/oom_crash/id:000008,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+159 Bytes
tests/fuzz_images/oom_crash/id:000009,sig:06,src:000000,op:havoc,rep:16
Binary file not shown.
Binary file added
BIN
+205 Bytes
tests/fuzz_images/oom_crash/id:000010,sig:06,src:000000,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000011,sig:06,src:000000,op:havoc,rep:16
Binary file not shown.
Binary file added
BIN
+193 Bytes
tests/fuzz_images/oom_crash/id:000012,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000013,sig:06,src:000000,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+188 Bytes
tests/fuzz_images/oom_crash/id:000014,sig:06,src:000000,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+178 Bytes
tests/fuzz_images/oom_crash/id:000015,sig:06,src:000000,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000016,sig:06,src:000000,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+3.96 KB
tests/fuzz_images/oom_crash/id:000021,sig:06,src:000004,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+3.96 KB
tests/fuzz_images/oom_crash/id:000022,sig:06,src:000004,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+3.23 KB
tests/fuzz_images/oom_crash/id:000025,sig:06,src:000007,op:havoc,rep:16
Binary file not shown.
Binary file added
BIN
+179 Bytes
tests/fuzz_images/oom_crash/id:000027,sig:06,src:000026+000062,op:splice,rep:8
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000028,sig:06,src:000027,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000029,sig:06,src:000027,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+187 Bytes
tests/fuzz_images/oom_crash/id:000030,sig:06,src:000027,op:havoc,rep:16
Binary file not shown.
Binary file added
BIN
+175 Bytes
tests/fuzz_images/oom_crash/id:000031,sig:06,src:000027,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000032,sig:06,src:000027,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+3.88 KB
tests/fuzz_images/oom_crash/id:000033,sig:06,src:000027+000178,op:splice,rep:64
Binary file not shown.
Binary file added
BIN
+166 Bytes
tests/fuzz_images/oom_crash/id:000034,sig:06,src:000040,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+156 Bytes
tests/fuzz_images/oom_crash/id:000035,sig:06,src:000056,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+176 Bytes
tests/fuzz_images/oom_crash/id:000036,sig:06,src:000059+000071,op:splice,rep:8
Binary file not shown.
Binary file added
BIN
+144 Bytes
tests/fuzz_images/oom_crash/id:000037,sig:06,src:000062,op:havoc,rep:32
Binary file not shown.
Binary file added
BIN
+221 Bytes
tests/fuzz_images/oom_crash/id:000038,sig:06,src:000066,op:havoc,rep:32
Binary file not shown.
Binary file added
BIN
+196 Bytes
tests/fuzz_images/oom_crash/id:000039,sig:06,src:000066+000044,op:splice,rep:4
Binary file not shown.
Binary file added
BIN
+183 Bytes
tests/fuzz_images/oom_crash/id:000040,sig:06,src:000068+000059,op:splice,rep:16
Binary file not shown.
Binary file added
BIN
+155 Bytes
tests/fuzz_images/oom_crash/id:000041,sig:06,src:000073,op:havoc,rep:16
Binary file not shown.
Binary file added
BIN
+154 Bytes
tests/fuzz_images/oom_crash/id:000042,sig:06,src:000087,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+3.96 KB
tests/fuzz_images/oom_crash/id:000043,sig:06,src:000181,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+3.23 KB
tests/fuzz_images/oom_crash/id:000045,sig:06,src:000266,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+158 Bytes
tests/fuzz_images/oom_crash/id:000046,sig:06,src:000276,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+209 KB
tests/fuzz_images/oom_crash/id:000048,sig:06,src:000313+000233,op:splice,rep:64
Binary file not shown.
Binary file added
BIN
+156 Bytes
tests/fuzz_images/oom_crash/id:000051,sig:06,src:000329,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+156 Bytes
tests/fuzz_images/oom_crash/id:000052,sig:06,src:000329,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+46.4 KB
tests/fuzz_images/oom_crash/id:000053,sig:06,src:000329+000130,op:splice,rep:128
Binary file not shown.
Binary file added
BIN
+201 Bytes
tests/fuzz_images/oom_crash/id:000054,sig:06,src:000331,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+209 KB
tests/fuzz_images/oom_crash/id:000056,sig:06,src:000351+000306,op:splice,rep:64
Binary file not shown.
Binary file added
BIN
+3.19 KB
tests/fuzz_images/oom_crash/id:000058,sig:06,src:000361,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+3.15 KB
tests/fuzz_images/oom_crash/id:000059,sig:06,src:000363,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+3.15 KB
tests/fuzz_images/oom_crash/id:000060,sig:06,src:000363,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+3.14 KB
tests/fuzz_images/oom_crash/id:000061,sig:06,src:000364,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+31.3 KB
tests/fuzz_images/oom_crash/id:000063,sig:06,src:000060+000137,op:splice,rep:128
Binary file not shown.
Binary file added
BIN
+1.13 KB
tests/fuzz_images/oom_crash/id:000064,sig:06,src:000394,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+46.6 KB
tests/fuzz_images/oom_crash/id:000068,sig:06,src:000127,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+46.6 KB
tests/fuzz_images/oor_panic/id:000017,sig:06,src:000001,op:havoc,rep:64
Binary file not shown.
Binary file added
BIN
+46.6 KB
tests/fuzz_images/oor_panic/id:000018,sig:06,src:000001,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+46.6 KB
tests/fuzz_images/oor_panic/id:000019,sig:06,src:000001,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+3.2 KB
tests/fuzz_images/oor_panic/id:000023,sig:06,src:000006,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+3.2 KB
tests/fuzz_images/oor_panic/id:000024,sig:06,src:000006,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+139 KB
tests/fuzz_images/oor_panic/id:000026,sig:06,src:000012,op:havoc,rep:2
Binary file not shown.
Binary file added
BIN
+3.2 KB
tests/fuzz_images/oor_panic/id:000044,sig:06,src:000224,op:havoc,rep:4
Binary file not shown.
Binary file added
BIN
+3.2 KB
tests/fuzz_images/oor_panic/id:000049,sig:06,src:000318,op:havoc,rep:8
Binary file not shown.
Binary file added
BIN
+3.15 KB
tests/fuzz_images/oor_panic/id:000050,sig:06,src:000322,op:havoc,rep:32
Binary file not shown.
Binary file added
BIN
+3.19 KB
tests/fuzz_images/oor_panic/id:000055,sig:06,src:000343,op:havoc,rep:2
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
extern crate tiff; | ||
|
||
use tiff::TiffResult; | ||
use tiff::decoder::Decoder; | ||
|
||
use std::fs::File; | ||
|
||
fn test_directory<F: Fn(File) -> bool>(path: &str, f: F) { | ||
for entry in std::fs::read_dir(path).unwrap() { | ||
let file = File::open(entry.unwrap().path()).unwrap(); | ||
assert!(f(file)); | ||
} | ||
} | ||
|
||
fn decode_tiff(file: File) -> TiffResult<()> { | ||
let mut decoder = Decoder::new(file)?; | ||
decoder.read_image()?; | ||
Ok(()) | ||
} | ||
|
||
#[test] | ||
fn oor_panic() { | ||
test_directory("./tests/fuzz_images/oor_panic", |file| { | ||
decode_tiff(file).ok(); | ||
true | ||
}); | ||
} | ||
|
||
#[test] | ||
fn oom_crash() { | ||
test_directory("./tests/fuzz_images/oom_crash", |file| { | ||
decode_tiff(file).is_err() | ||
}); | ||
} | ||
|
||
#[test] | ||
fn inf_loop() { | ||
test_directory("./tests/fuzz_images/inf_loop", |file| { | ||
decode_tiff(file).ok(); | ||
true | ||
}); | ||
} |