diff --git a/screen.c b/screen.c index 8d077d1..265d986 100644 --- a/screen.c +++ b/screen.c @@ -350,11 +350,16 @@ create_primary_surface(SpiceScreen *spice_screen, uint32_t width, QXLWorker *qxl_worker = spice_screen->qxl_worker; QXLDevSurfaceCreate surface = { 0, }; - g_assert(height <= MAX_HEIGHT); - g_assert(width <= MAX_WIDTH); g_assert(height > 0); g_assert(width > 0); + if (height > MAX_HEIGHT) + height = MAX_HEIGHT; + + if (width > MAX_WIDTH) + width = MAX_WIDTH; + + surface.format = SPICE_SURFACE_FMT_32_xRGB; surface.width = spice_screen->primary_width = width; surface.height = spice_screen->primary_height = height;