diff options
Diffstat (limited to 'remoting/client')
-rw-r--r-- | remoting/client/plugin/chromoting_instance.cc | 9 |
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"; |