Index: Source/platform/graphics/filters/FilterEffect.cpp |
diff --git a/Source/platform/graphics/filters/FilterEffect.cpp b/Source/platform/graphics/filters/FilterEffect.cpp |
index ce8f23f723481bd38b66d3446078b5c987ae6b66..f98698fcce391d3dae1619c1e9963f8effc4005e 100644 |
--- a/Source/platform/graphics/filters/FilterEffect.cpp |
+++ b/Source/platform/graphics/filters/FilterEffect.cpp |
@@ -36,6 +36,8 @@ |
namespace WebCore { |
+static const float kMaxFilterArea = 4096 * 4096; |
+ |
FilterEffect::FilterEffect(Filter* filter) |
: m_alphaImage(false) |
, m_filter(filter) |
@@ -54,14 +56,26 @@ FilterEffect::~FilterEffect() |
{ |
} |
-inline bool isFilterSizeValid(IntRect rect) |
+float FilterEffect::maxFilterArea() |
{ |
- if (rect.width() < 0 || rect.width() > kMaxFilterSize |
- || rect.height() < 0 || rect.height() > kMaxFilterSize) |
+ return kMaxFilterArea; |
+} |
+ |
+bool FilterEffect::isFilterSizeValid(const FloatRect& rect) |
+{ |
+ if (rect.width() < 0 || rect.height() < 0 |
+ || (rect.height() * rect.width() > kMaxFilterArea)) |
return false; |
+ |
return true; |
} |
+ |
+bool FilterEffect::isFilterSizeValid(const IntRect& rect) |
+{ |
+ return isFilterSizeValid(FloatRect(rect)); |
+} |
+ |
FloatRect FilterEffect::determineAbsolutePaintRect(const FloatRect& originalRequestedRect) |
{ |
FloatRect requestedRect = originalRequestedRect; |