[Spice-commits] server/display-channel.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu Oct 20 15:49:29 UTC 2016


 server/display-channel.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit beec1b4175b24d71a0a39482661926a8c76114b5
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Oct 20 12:36:06 2016 +0100

    display channel: Don't let client set too many surfaces
    
    Limit the n_surfaces argument to avoid overflowing the surfaces array.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Jonathon Jongsma <jjongsma at redhat.com>

diff --git a/server/display-channel.c b/server/display-channel.c
index 69edd35..0b8d6b5 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1946,7 +1946,7 @@ DisplayChannel* display_channel_new(RedsState *reds,
 #endif
     image_encoder_shared_init(&display->priv->encoder_shared_data);
 
-    display->priv->n_surfaces = n_surfaces;
+    display->priv->n_surfaces = MIN(n_surfaces, NUM_SURFACES);
     display->priv->renderer = RED_RENDERER_INVALID;
 
     ring_init(&display->priv->current_list);


More information about the Spice-commits mailing list