summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2016-10-20 12:36:06 +0100
committerFrediano Ziglio <fziglio@redhat.com>2016-10-20 16:43:51 +0100
commitbeec1b4175b24d71a0a39482661926a8c76114b5 (patch)
tree6a2327e801c7bb660deff6b28859ecba928ba839
parent090fbe5eeb163dc690a46f3df8ecd5665ff54504 (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.c2
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);