Re: [server] streaming: Don't start streaming if there is no video encoder

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

 



On 07/22/2016 09:11 PM, Francois Gouget wrote:
Without a video encoder no frame will be streamed anyway.
This fixes the case where the client does not support any of the
server's codecs, such as if it was compiled with --enable-gstvideo=no
--disable-builtin-mjpeg.

Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
---
 server/dcc-send.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/dcc-send.c b/server/dcc-send.c
index f5a409d..56bbf23 100644
--- a/server/dcc-send.c
+++ b/server/dcc-send.c
@@ -2159,6 +2159,10 @@ static void marshall_stream_start(RedChannelClient *rcc,

     agent->last_send_time = 0;
     spice_assert(stream);
+    if (!agent->video_encoder) {
+        /* Without a video encoder nothing will be streamed */
+        return;
+    }
     red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_STREAM_CREATE, NULL);
     SpiceMsgDisplayStreamCreate stream_create;
     SpiceClipRects clip_rects;


Hi,

This patch prevents a crash as few lines below there is access
to agent->video_encoder->codec_type.

I think it would be better to make the check it in
dcc_create_stream(), and replace the patch here to assert.

What happens with the stream in that case, dropped ?

Thanks,
    Uri.

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://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]