Bug 1346601 - Set surfaceRect to empty when surface becomes null. r?Bas
MozReview-Commit-ID: 78oyzgSr8VT
--- a/gfx/2d/FilterNodeSoftware.cpp
+++ b/gfx/2d/FilterNodeSoftware.cpp
@@ -746,17 +746,24 @@ FilterNodeSoftware::GetInputDataSourceSu
printf(" -- no input --</section>\n\n");
#endif
return nullptr;
}
if (aTransparencyPaddedSourceRect && !aTransparencyPaddedSourceRect->IsEmpty()) {
IntRect srcRect = aTransparencyPaddedSourceRect->Intersect(aRect);
surface = GetDataSurfaceInRect(surface, surfaceRect, srcRect, EDGE_MODE_NONE);
- surfaceRect = srcRect;
+ if (surface) {
+ surfaceRect = srcRect;
+ } else {
+ // Padding the surface with transparency failed, probably due to size
+ // restrictions. Since |surface| is now null, set the surfaceRect to
+ // empty so that we're consistent.
+ surfaceRect.SetEmpty();
+ }
}
RefPtr<DataSourceSurface> result =
GetDataSurfaceInRect(surface, surfaceRect, aRect, aEdgeMode);
if (result) {
// TODO: This isn't safe since we don't have a guarantee
// that future Maps will have the same stride
new file mode 100644
--- /dev/null
+++ b/gfx/tests/crashtests/1346601-1.html
@@ -0,0 +1,5 @@
+<svg>
+<filter id='a' width='181.412449629' primitiveUnits='objectBoundingBox'>
+<feConvolveMatrix kernelMatrix='0 1 1 1 0 0 0 0 0' kernelUnitLength='178'/>
+</filter>
+<polyline filter='url(#a)' points='47.2081,146 175.4644,1 260,191 4,0 85,176 88,248 16385,255.891 130,183 71,16'/>
--- a/gfx/tests/crashtests/crashtests.list
+++ b/gfx/tests/crashtests/crashtests.list
@@ -131,8 +131,9 @@ load 1134549-1.svg
load balinese-letter-spacing.html
load 1216832-1.html
load 1225125-1.html
load 1308394.html
load 1317403-1.html # bug 1331533
load 1325159-1.html
load 1331683.html
skip-if(Android) pref(dom.disable_open_during_load,false) load 1343666.html
+load 1346601-1.html