check m_width_abs > 0 to avoid division by zero (-fsanitize=undefined)
This commit is contained in:
parent
2a594d4f0e
commit
533c6d6e5b
1 changed files with 59 additions and 59 deletions
4
deps/agg/include/agg_math_stroke.h
vendored
4
deps/agg/include/agg_math_stroke.h
vendored
|
@ -391,12 +391,12 @@ namespace agg
|
|||
vc.remove_all();
|
||||
|
||||
double cp = cross_product(v0.x, v0.y, v1.x, v1.y, v2.x, v2.y);
|
||||
if(cp != 0 && (cp > 0) == (m_width > 0))
|
||||
if (cp != 0 && (cp > 0) == (m_width > 0) && m_width_abs > 0)
|
||||
{
|
||||
// Inner join
|
||||
//---------------
|
||||
double limit = ((len1 < len2) ? len1 : len2) / m_width_abs;
|
||||
if(limit < m_inner_miter_limit)
|
||||
if (limit < m_inner_miter_limit)
|
||||
{
|
||||
limit = m_inner_miter_limit;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue