From b83a6967c9c80404c180b1693dc5c55e8fc3e9d1 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Mon, 14 Mar 2016 15:05:45 -0400 Subject: [PATCH] rfbsrc: Cleanly handle security negotiation failure When the security cannot be negotiated, the server returns security type of 0 (failure). In that case, the next step is to read the error reason string. --- gst/librfb/rfbdecoder.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/librfb/rfbdecoder.c b/gst/librfb/rfbdecoder.c index bd225ad..e332c04 100644 --- a/gst/librfb/rfbdecoder.c +++ b/gst/librfb/rfbdecoder.c @@ -444,8 +444,11 @@ rfb_decoder_state_wait_for_security (RfbDecoder * decoder) GST_DEBUG ("security = %d", decoder->security_type); g_return_val_if_fail (decoder->security_type < 3, FALSE); - g_return_val_if_fail (decoder->security_type != SECURITY_FAIL, - rfb_decoder_state_reason (decoder)); + + if (decoder->security_type == SECURITY_FAIL) { + decoder->state = rfb_decoder_state_reason; + return TRUE; + } } else { /* \TODO Add behavior for the rfb 3.7 and 3.8 servers */ GST_WARNING ("Other versions are not yet supported"); -- 2.7.4