[Spice-commits] configure.ac meson.build server/reds.cpp

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 14 13:35:52 UTC 2020


 configure.ac    |    2 +-
 meson.build     |    2 +-
 server/reds.cpp |   12 ++++++++++--
 3 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 828c881bd0a8d73a5c2038bdf22cb8ae7c793428
Author: Marc-André Lureau <marcandre.lureau at redhat.com>
Date:   Thu Aug 13 23:48:25 2020 +0400

    agent/qxl: add monitors physical dimensions handling
    
    Requires
    https://gitlab.freedesktop.org/spice/spice-protocol/-/merge_requests/24
    
    Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/configure.ac b/configure.ac
index 63699122..035bab51 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,7 +164,7 @@ AM_CONDITIONAL(HAVE_SASL, test "x$have_sasl" = "xyes")
 
 dnl =========================================================================
 dnl Check deps
-m4_define([SPICE_PROTOCOL_MIN_VER],[0.14.0])
+m4_define([SPICE_PROTOCOL_MIN_VER],[0.14.3])
 m4_include([subprojects/spice-common/m4/common.m4])
 
 AC_CHECK_LIBM
diff --git a/meson.build b/meson.build
index 8aab78a5..b7d6e8b3 100644
--- a/meson.build
+++ b/meson.build
@@ -50,7 +50,7 @@ spice_server_include = [include_directories('.')]
 spice_server_deps = [dependency('threads')]
 spice_server_link_args = []
 spice_server_requires = ''
-spice_protocol_version='0.14.0'
+spice_protocol_version='0.14.3'
 
 #
 # Spice common subproject
diff --git a/server/reds.cpp b/server/reds.cpp
index edbd09de..bfe525bf 100644
--- a/server/reds.cpp
+++ b/server/reds.cpp
@@ -1111,10 +1111,12 @@ static void reds_on_main_agent_monitors_config(RedsState *reds,
 {
     const unsigned int MAX_NUM_MONITORS = 256;
     const unsigned int MAX_MONITOR_CONFIG_SIZE =
-       sizeof(VDAgentMonitorsConfig) + MAX_NUM_MONITORS * sizeof(VDAgentMonConfig);
+        sizeof(VDAgentMonitorsConfig) +
+        MAX_NUM_MONITORS * (sizeof(VDAgentMonConfig) + sizeof(VDAgentMonitorMM));
 
     VDAgentMessage *msg_header;
     VDAgentMonitorsConfig *monitors_config;
+    size_t monitor_size = sizeof(VDAgentMonConfig);
     SpiceBuffer *cmc = &reds->client_monitors_config;
     uint32_t max_monitors;
 
@@ -1140,9 +1142,15 @@ static void reds_on_main_agent_monitors_config(RedsState *reds,
         goto overflow;
     }
     monitors_config = (VDAgentMonitorsConfig *)(cmc->buffer + sizeof(*msg_header));
+    /* filter out not known flags */
+    monitors_config->flags &= ~(VD_AGENT_CONFIG_MONITORS_FLAG_USE_POS |
+        VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE);
+    if ((monitors_config->flags & VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE) != 0) {
+        monitor_size += sizeof(VDAgentMonitorMM);
+    }
     // limit the monitor number to avoid buffer overflows
     max_monitors = (msg_header->size - sizeof(VDAgentMonitorsConfig)) /
-                   sizeof(VDAgentMonConfig);
+                   monitor_size;
     if (monitors_config->num_of_monitors > max_monitors) {
         goto overflow;
     }


More information about the Spice-commits mailing list