diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2016-10-20 12:36:06 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2016-10-20 16:43:51 +0100 |
commit | beec1b4175b24d71a0a39482661926a8c76114b5 (patch) | |
tree | 6a2327e801c7bb660deff6b28859ecba928ba839 | |
parent | 090fbe5eeb163dc690a46f3df8ecd5665ff54504 (diff) |
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@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
-rw-r--r-- | server/display-channel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/display-channel.c b/server/display-channel.c index 69edd359..0b8d6b50 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); |