Repository: incubator-guacamole-server Updated Branches: refs/heads/master 5d5fbb4d4 -> 3f2cdb197
GUACAMOLE-184: Only send contents of surface if non-empty. Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/bd3d482a Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/bd3d482a Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/bd3d482a Branch: refs/heads/master Commit: bd3d482adeee4fbeb7a5b3acdd43b96629fdbe4e Parents: 5d5fbb4 Author: Michael Jumper <[email protected]> Authored: Mon Sep 12 23:05:18 2016 -0700 Committer: Michael Jumper <[email protected]> Committed: Wed Jan 25 19:28:07 2017 -0800 ---------------------------------------------------------------------- src/common/surface.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/bd3d482a/src/common/surface.c ---------------------------------------------------------------------- diff --git a/src/common/surface.c b/src/common/surface.c index 99e91c0..dbb3b58 100644 --- a/src/common/surface.c +++ b/src/common/surface.c @@ -1718,15 +1718,20 @@ void guac_common_surface_dup(guac_common_surface* surface, guac_user* user, guac_protocol_send_size(socket, surface->layer, surface->width, surface->height); - /* Get entire surface */ - cairo_surface_t* rect = cairo_image_surface_create_for_data( - surface->buffer, CAIRO_FORMAT_RGB24, - surface->width, surface->height, surface->stride); - - /* Send PNG for rect */ - guac_user_stream_png(user, socket, GUAC_COMP_OVER, surface->layer, - 0, 0, rect); - cairo_surface_destroy(rect); + /* Send contents of layer, if non-empty */ + if (surface->width > 0 && surface->height > 0) { + + /* Get entire surface */ + cairo_surface_t* rect = cairo_image_surface_create_for_data( + surface->buffer, CAIRO_FORMAT_RGB24, + surface->width, surface->height, surface->stride); + + /* Send PNG for rect */ + guac_user_stream_png(user, socket, GUAC_COMP_OVER, surface->layer, + 0, 0, rect); + cairo_surface_destroy(rect); + + } complete: pthread_mutex_unlock(&surface->_lock);
