From: Jaroslav Kysela Date: Tue, 24 Mar 2015 07:55:35 +0000 (+0100) Subject: SAT>IP Server: fix new session id assignment, fix possible null dereference X-Git-Tag: v4.1~209 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F614%2Fhead;p=thirdparty%2Ftvheadend.git SAT>IP Server: fix new session id assignment, fix possible null dereference --- diff --git a/src/satip/rtsp.c b/src/satip/rtsp.c index b23cbaa4f..b2eb03f7c 100644 --- a/src/satip/rtsp.c +++ b/src/satip/rtsp.c @@ -162,7 +162,7 @@ rtsp_new_session(int delsys, uint32_t nsession, int session) rs->nsession = nsession ?: session_number; snprintf(rs->session, sizeof(rs->session), "%08X", session_number); - if (nsession) { + if (!nsession) { session_number += 9876; if (session_number == 0) session_number += 9876; @@ -504,7 +504,7 @@ rtsp_start rtsp_muxcnf == MUXCNF_REJECT ? " (configuration)" : ""); goto endclean; } - if (rs->mux == mux) + if (rs->mux == mux && rs->subs) goto pids; rtsp_clean(rs); rs->mux = mux; @@ -528,6 +528,8 @@ rtsp_start } } else { pids: + if (!rs->subs) + goto endclean; svc = (mpegts_service_t *)rs->subs->ths_service; svc->s_update_pids(svc, &rs->pids); satip_rtp_update_pids((void *)(intptr_t)rs->stream, &rs->pids);