Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3b72291

Browse files
committed
non-invertible matrices should produce unbounded results
1 parent 3249ec7 commit 3b72291

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

impeller/entity/contents/filters/matrix_filter_contents.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ std::optional<Rect> MatrixFilterContents::GetFilterSourceCoverage(
7474
auto transform = effect_transform * //
7575
matrix_ * //
7676
effect_transform.Invert(); //
77+
if (transform.GetDeterminant() == 0.0) {
78+
return std::nullopt;
79+
}
7780
auto inverse = transform.Invert();
7881
return output_limit.TransformBounds(inverse);
7982
}

0 commit comments

Comments
 (0)