Index: ui/display/fake_display_snapshot.cc |
diff --git a/ui/display/fake_display_snapshot.cc b/ui/display/fake_display_snapshot.cc |
index f34177d5ad2f16537cb2613e68327aa6d4d6de9e..1471f5e16558d4eb65b02319d4aab2911e56a4df 100644 |
--- a/ui/display/fake_display_snapshot.cc |
+++ b/ui/display/fake_display_snapshot.cc |
@@ -97,6 +97,11 @@ std::unique_ptr<ui::DisplayMode> ParseDisplayMode(const std::string& str) { |
return nullptr; |
} |
+ if (width <= 0 || height <= 0) { |
+ LOG(ERROR) << "Resolution " << width << "x" << height << " is invalid"; |
+ return nullptr; |
+ } |
+ |
// Refresh rate is optional and will be be 60 if not specified. |
double refresh_rate = 60.0f; |
if (!refresh_rate_str.empty() && |