mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-14 12:04:29 +00:00
sw_engine: fix potential data overflow.
Change-Id: Ie800fda74d44ad3741f7a92f12681f7f753ee50c
This commit is contained in:
parent
3b9bb51321
commit
ac4405a4ec
1 changed files with 1 additions and 1 deletions
|
@ -377,7 +377,7 @@ SwFixed mathLength(SwPoint& pt)
|
||||||
_polarize(v);
|
_polarize(v);
|
||||||
v.x = _downscale(v.x);
|
v.x = _downscale(v.x);
|
||||||
|
|
||||||
if (shift > 0) return (v.x + (1 << (shift -1))) >> shift;
|
if (shift > 0) return (v.x + (static_cast<SwFixed>(1) << (shift -1))) >> shift;
|
||||||
return static_cast<SwFixed>((uint32_t)v.x << -shift);
|
return static_cast<SwFixed>((uint32_t)v.x << -shift);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue