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

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
« no previous file with comments | « remoting/proto/control.proto ('k') | remoting/protocol/webrtc_video_renderer_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..224c943a1468710a786640e0b1ffbb6acb5fb76f 100644
--- a/remoting/protocol/host_control_dispatcher.cc
+++ b/remoting/protocol/host_control_dispatcher.cc
@@ -72,10 +72,17 @@ void HostControlDispatcher::OnIncomingMessage(
if (!message)
return;
+ // TODO(sergeyu): Move message valudation from the message handlers here.
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);
} else if (message->has_video_control()) {
host_stub_->ControlVideo(message->video_control());
} else if (message->has_audio_control()) {
« no previous file with comments | « remoting/proto/control.proto ('k') | remoting/protocol/webrtc_video_renderer_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698