mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 12:13:22 +00:00
Bug 1555851 - Detect motion path measurement failures. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D37337 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
43f890d3a4
commit
b8f227ec6f
@ -240,6 +240,7 @@ void SVGMotionSMILAnimationFunction::RebuildPathAndVerticesFromPathAttr() {
|
||||
bool ok = path.GetDistancesFromOriginToEndsOfVisibleSegments(&mPathVertices);
|
||||
if (!ok || !mPathVertices.Length()) {
|
||||
mPath = nullptr;
|
||||
mPathVertices.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -165,6 +165,12 @@ bool SVGPathData::GetDistancesFromOriginToEndsOfVisibleSegments(
|
||||
uint32_t segType = SVGPathSegUtils::DecodeType(mData[i]);
|
||||
SVGPathSegUtils::TraversePathSegment(&mData[i], state);
|
||||
|
||||
// With degenerately large point coordinates, TraversePathSegment can fail
|
||||
// and end up producing NaNs.
|
||||
if (!isfinite(state.length)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// We skip all moveto commands except an initial moveto. See the text 'A
|
||||
// "move to" command does not count as an additional point when dividing up
|
||||
// the duration...':
|
||||
|
8
layout/svg/crashtests/1555851.html
Normal file
8
layout/svg/crashtests/1555851.html
Normal file
@ -0,0 +1,8 @@
|
||||
<body>
|
||||
<script>
|
||||
var o0 = document.createElementNS("http://www.w3.org/2000/svg", "svg")
|
||||
document.body.appendChild(o0)
|
||||
var o3 = document.createElementNS("http://www.w3.org/2000/svg", "animateMotion")
|
||||
o0.appendChild(o3)
|
||||
o3.setAttribute("path", "M9,2l2e37,3A40,2 85,102-1")
|
||||
</script>
|
@ -229,3 +229,4 @@ load 1536892.html
|
||||
load 1539318-1.svg
|
||||
load 1548985-1.html
|
||||
load 1548985-2.svg
|
||||
load 1555851.html
|
||||
|
Loading…
x
Reference in New Issue
Block a user