diff options
author | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 20:43:51 +0000 |
---|---|---|
committer | wez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 20:43:51 +0000 |
commit | a462eb604b7976fc6e264cca846a9c92e34254c5 (patch) | |
tree | 2b608cb4bc7e1c5bbd800566b5c415c8da668e9e | |
parent | eae9271fb3505f6cce54296ff4c07aa279b5eb4d (diff) | |
download | chromium_src-a462eb604b7976fc6e264cca846a9c92e34254c5.zip chromium_src-a462eb604b7976fc6e264cca846a9c92e34254c5.tar.gz chromium_src-a462eb604b7976fc6e264cca846a9c92e34254c5.tar.bz2 |
Check for negative cursor width and height.
BUG=160918
Review URL: https://chromiumcodereview.appspot.com/11361254
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167738 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc index 362b11c..f3d006c 100644 --- a/remoting/client/plugin/chromoting_instance.cc +++ b/remoting/client/plugin/chromoting_instance.cc @@ -433,21 +433,25 @@ void ChromotingInstance::SetCursorShape( return; } - if (pp::ImageData::GetNativeImageDataFormat() != - PP_IMAGEDATAFORMAT_BGRA_PREMUL) { - VLOG(2) << "Unable to set cursor shape - non-native image format"; - return; - } - int width = cursor_shape.width(); int height = cursor_shape.height(); + if (width < 0 || height < 0) { + return; + } + if (width > 32 || height > 32) { VLOG(2) << "Cursor too large for SetCursor: " << width << "x" << height << " > 32x32"; return; } + if (pp::ImageData::GetNativeImageDataFormat() != + PP_IMAGEDATAFORMAT_BGRA_PREMUL) { + VLOG(2) << "Unable to set cursor shape - non-native image format"; + return; + } + int hotspot_x = cursor_shape.hotspot_x(); int hotspot_y = cursor_shape.hotspot_y(); |