Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Unified Diff: ui/display/fake_display_snapshot.cc

Issue 2437053002: Catch bad display sizes. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/display/fake_display_snapshot_unittests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() &&
« no previous file with comments | « no previous file | ui/display/fake_display_snapshot_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698