[PATCH] dcc: avoid to report errors triggered by client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]