dcc: avoid to report errors triggered by client

Client can always send report even if a stream is not available.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2015-12-22 16:42:44 +00:00
parent d3b5d2c97e
commit 1b6af4779a

View File

@ -1314,9 +1314,15 @@ static int dcc_handle_stream_report(DisplayChannelClient *dcc,
{
StreamAgent *agent;
spice_return_val_if_fail(report->stream_id < NUM_STREAMS, FALSE);
if (report->stream_id >= NUM_STREAMS) {
return FALSE;
}
agent = &dcc->stream_agents[report->stream_id];
spice_return_val_if_fail(agent->mjpeg_encoder, TRUE);
if (!agent->mjpeg_encoder) {
return TRUE;
}
spice_return_val_if_fail(report->unique_id == agent->report_id, TRUE);
mjpeg_encoder_client_stream_report(agent->mjpeg_encoder,