Bug 307565 - crash when filtering nothing, or <feMerge> with no children.
r=scootermorris git-svn-id: svn://10.0.0.236/trunk@180030 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
a7a860fed3
commit
1f92111d10
@ -1470,6 +1470,8 @@ nsSVGFEMergeElement::Filter(nsSVGFilterInstance *instance)
|
||||
PRUint32 width, height, length;
|
||||
targetImage->Lock();
|
||||
targetImage->GetData(&targetData, &length, &stride);
|
||||
targetImage->GetWidth(&width);
|
||||
targetImage->GetHeight(&height);
|
||||
|
||||
PRUint32 count = GetChildCount();
|
||||
for (PRUint32 i = 0; i < count; i++) {
|
||||
@ -1501,9 +1503,6 @@ nsSVGFEMergeElement::Filter(nsSVGFilterInstance *instance)
|
||||
sourceImage->Lock();
|
||||
sourceImage->GetData(&sourceData, &length, &stride);
|
||||
|
||||
sourceImage->GetWidth(&width);
|
||||
sourceImage->GetHeight(&height);
|
||||
|
||||
#define BLEND(target, source, alpha) \
|
||||
target = PR_MIN(255, (target * (255 - alpha))/255 + source)
|
||||
|
||||
|
||||
@ -357,6 +357,9 @@ nsSVGFilterFrame::FilterPaint(nsISVGRendererCanvas *aCanvas,
|
||||
aTarget->GetBBox(getter_AddRefs(bbox));
|
||||
|
||||
if (type == nsIDOMSVGFilterElement::SVG_FUNITS_OBJECTBOUNDINGBOX) {
|
||||
if (!bbox)
|
||||
return NS_OK;
|
||||
|
||||
bbox->GetX(&x);
|
||||
x += nsSVGUtils::ObjectSpace(bbox, mX, nsSVGUtils::X);
|
||||
bbox->GetY(&y);
|
||||
@ -494,6 +497,8 @@ NS_IMETHODIMP
|
||||
nsSVGFilterFrame::GetInvalidationRegion(nsIFrame *aTarget,
|
||||
nsISVGRendererRegion **aRegion)
|
||||
{
|
||||
*aRegion = nsnull;
|
||||
|
||||
nsIContent *targetContent = aTarget->GetContent();
|
||||
nsISVGChildFrame *svg;
|
||||
|
||||
@ -523,6 +528,9 @@ nsSVGFilterFrame::GetInvalidationRegion(nsIFrame *aTarget,
|
||||
svg->GetBBox(getter_AddRefs(bbox));
|
||||
|
||||
if (type == nsIDOMSVGFilterElement::SVG_FUNITS_OBJECTBOUNDINGBOX) {
|
||||
if (!bbox)
|
||||
return NS_OK;
|
||||
|
||||
bbox->GetX(&x);
|
||||
x += nsSVGUtils::ObjectSpace(bbox, mX, nsSVGUtils::X);
|
||||
bbox->GetY(&y);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user