mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 952270 - Null check result of GetPathForLengthOrPositionMeasuring in nsSVGTextFrame2::GetTextPath. r=longsonr
This commit is contained in:
parent
9a7416c000
commit
de5393c04d
9
layout/svg/crashtests/952270-1.svg
Normal file
9
layout/svg/crashtests/952270-1.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<path id="path" transform="scale(2,1)" />
|
||||
|
||||
<text>
|
||||
<textPath xlink:href="#path">F</textPath>
|
||||
</text>
|
||||
|
||||
</svg>
|
After Width: | Height: | Size: 213 B |
@ -177,3 +177,4 @@ load 897342-1.svg
|
||||
load 898909-1.svg
|
||||
load 898951-1.svg
|
||||
load 919371-1.xhtml
|
||||
load 952270-1.svg
|
||||
|
@ -4719,22 +4719,26 @@ nsSVGTextFrame2::GetTextPath(nsIFrame* aTextPathFrame)
|
||||
{
|
||||
nsIFrame *pathFrame = GetTextPathPathFrame(aTextPathFrame);
|
||||
|
||||
if (pathFrame) {
|
||||
nsSVGPathGeometryElement *element =
|
||||
static_cast<nsSVGPathGeometryElement*>(pathFrame->GetContent());
|
||||
|
||||
RefPtr<Path> path = element->GetPathForLengthOrPositionMeasuring();
|
||||
|
||||
gfxMatrix matrix = element->PrependLocalTransformsTo(gfxMatrix());
|
||||
if (!matrix.IsIdentity()) {
|
||||
RefPtr<PathBuilder> builder =
|
||||
path->TransformedCopyToBuilder(ToMatrix(matrix));
|
||||
path = builder->Finish();
|
||||
}
|
||||
|
||||
return path.forget();
|
||||
if (!pathFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
nsSVGPathGeometryElement *element =
|
||||
static_cast<nsSVGPathGeometryElement*>(pathFrame->GetContent());
|
||||
|
||||
RefPtr<Path> path = element->GetPathForLengthOrPositionMeasuring();
|
||||
if (!path) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gfxMatrix matrix = element->PrependLocalTransformsTo(gfxMatrix());
|
||||
if (!matrix.IsIdentity()) {
|
||||
RefPtr<PathBuilder> builder =
|
||||
path->TransformedCopyToBuilder(ToMatrix(matrix));
|
||||
path = builder->Finish();
|
||||
}
|
||||
|
||||
return path.forget();
|
||||
}
|
||||
|
||||
gfxFloat
|
||||
|
Loading…
Reference in New Issue
Block a user