[Spice-devel] [PATCH] dcc: avoid to report errors triggered by client
Christophe Fergeau
cfergeau at redhat.com
Mon Jan 11 06:06:56 PST 2016
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
On Fri, Jan 08, 2016 at 11:30:09AM +0000, Frediano Ziglio wrote:
> Client can always send report even if a stream is not available.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/dcc.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/server/dcc.c b/server/dcc.c
> index 7c16fc0..47dcc76 100644
> --- a/server/dcc.c
> +++ b/server/dcc.c
> @@ -1332,9 +1332,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,
> --
> 2.4.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20160111/53f158f7/attachment.sig>
More information about the Spice-devel
mailing list