Index: ui/gfx/transform.cc |
diff --git a/ui/gfx/transform.cc b/ui/gfx/transform.cc |
index a4a4e64bb7497a0f84d7b7a50a1eb490671a7c4f..c2b6ba2fa9dffe86b6d2e7795ea3096f1479161f 100644 |
--- a/ui/gfx/transform.cc |
+++ b/ui/gfx/transform.cc |
@@ -245,7 +245,14 @@ bool Transform::IsBackFaceVisible() const { |
} |
bool Transform::GetInverse(Transform* transform) const { |
- return matrix_.invert(&transform->matrix_); |
+ if (!matrix_.invert(&transform->matrix_)) { |
+ // Initialize the return value to identity if this matrix turned |
+ // out to be un-invertible. |
+ transform->MakeIdentity(); |
+ return false; |
+ } |
+ |
+ return true; |
} |
void Transform::Transpose() { |