diff options
author | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 00:13:16 +0000 |
---|---|---|
committer | garykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-02-05 00:13:16 +0000 |
commit | 2d018fe8f4f221bd780f4945bba658eed1c061fd (patch) | |
tree | d3b4892c386120bc372bf5915df478e6be54ad3e /remoting/client | |
parent | 41db7a692d977b3c13bc1f968c100315a702ad03 (diff) | |
download | chromium_src-2d018fe8f4f221bd780f4945bba658eed1c061fd.zip chromium_src-2d018fe8f4f221bd780f4945bba658eed1c061fd.tar.gz chromium_src-2d018fe8f4f221bd780f4945bba658eed1c061fd.tar.bz2 |
[Chromoting] Check cursor data size on client before copying data.
Review URL: https://chromiumcodereview.appspot.com/11642060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180568 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 871b99b..90f08287 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -456,6 +456,14 @@ void ChromotingInstance::SetCursorShape( return; } + uint32 cursor_total_bytes = width * height * kBytesPerPixel; + if (cursor_shape.data().size() < cursor_total_bytes) { + VLOG(2) << "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"; |