summaryrefslogtreecommitdiffstats
path: root/remoting/client
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-21 02:47:29 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-21 02:47:29 +0000
commitc68e3e5a9ee8ff4bcd702c4c10a4eac0369a2431 (patch)
tree755c032397f523491546ba67a37c8d708b580149 /remoting/client
parent748aad0d85144cd6c92afb032e1830db1042d816 (diff)
downloadchromium_src-c68e3e5a9ee8ff4bcd702c4c10a4eac0369a2431.zip
chromium_src-c68e3e5a9ee8ff4bcd702c4c10a4eac0369a2431.tar.gz
chromium_src-c68e3e5a9ee8ff4bcd702c4c10a4eac0369a2431.tar.bz2
[Chromoting] Check cursor data size on client before copying data.
BUG= Review URL: https://codereview.chromium.org/11308264 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174322 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r--remoting/client/plugin/chromoting_instance.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 4b2be13..ee8459d 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -456,6 +456,15 @@ void ChromotingInstance::SetCursorShape(
return;
}
+ int cursor_total_bytes = width * height * kBytesPerPixel;
+ if (cursor_shape.data().size() < cursor_total_bytes) {
+ VLOG(2) << "Not enough cursor data. Expected "
+ << cursor_total_bytes << " bytes for a "
+ << width << "x" << height << " cursor. Only received "
+ << cursor_shape.data().size() << " bytes";
+ return;
+ }
+
if (pp::ImageData::GetNativeImageDataFormat() !=
PP_IMAGEDATAFORMAT_BGRA_PREMUL) {
VLOG(2) << "Unable to set cursor shape - non-native image format";