summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancois Gouget <fgouget@codeweavers.com>2016-08-11 13:44:18 +0100
committerFrediano Ziglio <fziglio@redhat.com>2016-08-11 13:45:51 +0100
commitef9538efd36aa025bc4d7d3fe9f6a111f6a9a09c (patch)
treed602aed15ba8f56922388c1c148fbbc7e544e321
parenta0c7e6b1249089ddbfc64823ddb86b296ee92dc8 (diff)
streaming: Check the stream id in display_update_stream_report() too
It's safer and more consistent than assuming the caller has done the check already. Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
-rw-r--r--src/channel-display.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/channel-display.c b/src/channel-display.c
index cf9c583..b4c9ec0 100644
--- a/src/channel-display.c
+++ b/src/channel-display.c
@@ -1222,9 +1222,16 @@ void stream_display_frame(display_stream *st, SpiceMsgIn *frame_msg,
static void display_update_stream_report(SpiceDisplayChannel *channel, uint32_t stream_id,
uint32_t frame_time, int32_t latency)
{
- display_stream *st = channel->priv->streams[stream_id];
+ SpiceDisplayChannelPrivate *c = channel->priv;
+ display_stream *st;
guint64 now;
+ g_return_if_fail(c != NULL);
+ g_return_if_fail(c->streams != NULL);
+ g_return_if_fail(c->nstreams > stream_id);
+
+ st = channel->priv->streams[stream_id];
+
if (!st->report_is_active) {
return;
}