Index: ui/gfx/geometry/size.cc |
diff --git a/ui/gfx/geometry/size.cc b/ui/gfx/geometry/size.cc |
index 86e1aeb9b174f90345880a02af21d694acb1ecc6..e58bb22fd8e535cdc914e12e715a58cac4e8f3d7 100644 |
--- a/ui/gfx/geometry/size.cc |
+++ b/ui/gfx/geometry/size.cc |
@@ -12,6 +12,7 @@ |
#include <ApplicationServices/ApplicationServices.h> |
#endif |
+#include "base/numerics/safe_math.h" |
#include "base/strings/stringprintf.h" |
#include "ui/gfx/geometry/size_conversions.h" |
@@ -44,7 +45,9 @@ CGSize Size::ToCGSize() const { |
#endif |
int Size::GetArea() const { |
- return width() * height(); |
+ base::CheckedNumeric<int> checked_area = width(); |
+ checked_area *= height(); |
+ return checked_area.ValueOrDie(); |
} |
void Size::Enlarge(int grow_width, int grow_height) { |