summaryrefslogtreecommitdiffstats
path: root/remoting/client
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/client')
-rw-r--r--remoting/client/plugin/chromoting_instance.cc16
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();