You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below panics.
Latest version : tiny-skia = "0.6.6"
The panic come from the a debug_assert! in src/scan/path.rs
use tiny_skia::*;fnmain(){// special valuelet v = -6.40969;let clip_path = {letmut pb = PathBuilder::new();
pb.push_circle(v, v, v);// special values
pb.push_circle(823811.0, v,824467.0);
pb.finish().unwrap()};// special valueslet clip_path = clip_path.transform(Transform::from_row(v,824060.0,0.0,0.0,0.0,0.0)).unwrap();letmut clip_mask = ClipMask::new();// panic here
clip_mask.set_path(500,500,&clip_path,FillRule::EvenOdd,true);}
Stacktrace :
thread 'main' panicked at 'assertion failed: edges[curr_idx].last_y >= curr_y as i32', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.6/src/scan/path.rs:178:13
stack backtrace:
0: rust_begin_unwind
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:584:5
1: core::panicking::panic_fmt
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:143:14
2: core::panicking::panic
at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/panicking.rs:48:5
3: tiny_skia::scan::path::walk_edges
at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.6/src/scan/path.rs:178:13
4: tiny_skia::scan::path::fill_path_impl
at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.6/src/scan/path.rs:155:5
5: tiny_skia::scan::path_aa::fill_path_impl
at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.6/src/scan/path_aa.rs:106:5
6: tiny_skia::scan::path_aa::fill_path
at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.6/src/scan/path_aa.rs:62:5
7: tiny_skia::clip::ClipMask::set_path
at ~/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.6/src/clip.rs:94:13
The text was updated successfully, but these errors were encountered:
I found 3 more crashes : maybe we have to somehow include fuzz-like tests.
AFL++ find them very quickly ~250ms. (so maybe be in Github actions/workflows)
What do you think ? @RazrFalcon
I'm not sure we should/can do this on CI. But a subcrate, so people can run it themselves is a good idea.
The reason tiny-skia doesn't have fuzzy-testing is because I don't have time implementing it. That's the only reason.
Damn, clipping is implemented a bit incorrectly. I do not handle large paths at all. I would have to rewrite it from scratch. No idea how long it would take.
Clipping is one of the parts that wasn't ported from Skia and it's kinda meh. Skia clipper is like 5 KLOC. See #9
It's a bug, but not very critical one. You have to really try to hit it.
The code below panics.
Latest version : tiny-skia = "0.6.6"
The panic come from the a
debug_assert!
insrc/scan/path.rs
Stacktrace :
The text was updated successfully, but these errors were encountered: