[win32/vd_agent 1/4] construct WDDMMonitorConfigEscape also with NULL DisplayMode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Adding possibility to construct WDDMMonitorConfigEscape object
with NULL parameter of DisplayMode. In this case all the fields
depending on DisplayMode are set to zero.

Signed-off-by: Yuri Benditovich <yuri.benditovich@xxxxxxxxxx>
---
 vdagent/display_configuration.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vdagent/display_configuration.cpp b/vdagent/display_configuration.cpp
index cdbbe23..bb2fb80 100644
--- a/vdagent/display_configuration.cpp
+++ b/vdagent/display_configuration.cpp
@@ -242,10 +242,10 @@ struct WDDMMonitorConfigEscape {
     {
         _ioctl = QXL_ESCAPE_MONITOR_CONFIG;
         _head.id = _head.surface_id = 0;
-        _head.x = mode->get_pos_x();
-        _head.y = mode->get_pos_y();
-        _head.width = mode->get_width();
-        _head.height = mode->get_height();
+        _head.x = mode ? mode->get_pos_x() : 0;
+        _head.y = mode ? mode->get_pos_y() : 0;
+        _head.width = mode ? mode->get_width() : 0;
+        _head.height = mode ? mode->get_height() : 0;
     }
     uint32_t    _ioctl;
     QXLHead     _head;
-- 
2.16.1.windows.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]