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

Unified Diff: remoting/protocol/host_control_dispatcher.cc

Issue 2021773002: Use only DIPs size in ClientResolution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: remoting/protocol/host_control_dispatcher.cc
diff --git a/remoting/protocol/host_control_dispatcher.cc b/remoting/protocol/host_control_dispatcher.cc
index 7f3ea272e1affdf4c0aa8281ce3834115fe84815..3e5260cfab7eb736b3d214e37169a28128835b85 100644
--- a/remoting/protocol/host_control_dispatcher.cc
+++ b/remoting/protocol/host_control_dispatcher.cc
@@ -75,7 +75,13 @@ void HostControlDispatcher::OnIncomingMessage(
if (message->has_clipboard_event()) {
clipboard_stub_->InjectClipboardEvent(message->clipboard_event());
} else if (message->has_client_resolution()) {
- host_stub_->NotifyClientResolution(message->client_resolution());
+ const ClientResolution& resolution = message->client_resolution();
+ if (!resolution.has_dips_width() || !resolution.has_dips_height() ||
+ resolution.dips_width() <= 0 || resolution.dips_height() <= 0) {
+ LOG(ERROR) << "Received invalid ClientResolution message.";
+ return;
+ }
+ host_stub_->NotifyClientResolution(resolution);
Jamie 2016/05/31 20:40:47 It seems odd that this is the only message we vali
Sergey Ulanov 2016/06/01 10:08:51 Agree. Added a TODO.
} else if (message->has_video_control()) {
host_stub_->ControlVideo(message->video_control());
} else if (message->has_audio_control()) {

Powered by Google App Engine
This is Rietveld 408576698