зеркало из https://github.com/mozilla/gecko-dev.git
Protect against possibility of having no content parent in GetCanvasTM -- resolves crash in bug 308585
r=tor
This commit is contained in:
Родитель
b326071feb
Коммит
dabfcf56f1
|
@ -330,7 +330,13 @@ nsSVGPatternFrame::GetCanvasTM() {
|
||||||
} else {
|
} else {
|
||||||
// No, we'll use our content parent, then
|
// No, we'll use our content parent, then
|
||||||
nsCOMPtr<nsISVGGeometrySource> aSource = do_QueryInterface(mParent);
|
nsCOMPtr<nsISVGGeometrySource> aSource = do_QueryInterface(mParent);
|
||||||
aSource->GetCanvasTM(&aCTM);
|
if (aSource) {
|
||||||
|
aSource->GetCanvasTM(&aCTM);
|
||||||
|
} else {
|
||||||
|
// OK, we have no content parent, which means that we're
|
||||||
|
// not part of the document tree. Return an identity matrix?
|
||||||
|
NS_NewSVGMatrix(&aCTM, 1.0f,0.0f,0.0f,1.0f,0.0f,0.0f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return aCTM;
|
return aCTM;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче