diff options
| author | Max <me@mkor.je> | 2024-11-26 12:39:00 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 12:39:00 +0000 |
| commit | 39e41ba3c6e8b78324f30b6513c81f31b84472d9 (patch) | |
| tree | 259c915dcdcba67437f878f427b3d7b2ff992ce0 /crates/typst-layout/src | |
| parent | fd5e642fb495e98bde0f7e7fd16dca7ac355c60a (diff) | |
Fix `path` with infinite length causing panic (#5457)
Diffstat (limited to 'crates/typst-layout/src')
| -rw-r--r-- | crates/typst-layout/src/shapes.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/typst-layout/src/shapes.rs b/crates/typst-layout/src/shapes.rs index 81be1219..a3502172 100644 --- a/crates/typst-layout/src/shapes.rs +++ b/crates/typst-layout/src/shapes.rs @@ -114,6 +114,10 @@ pub fn layout_path( path.close_path(); } + if !size.is_finite() { + bail!(elem.span(), "cannot create path with infinite length"); + } + // Prepare fill and stroke. let fill = elem.fill(styles); let fill_rule = elem.fill_rule(styles); |
