From 7021d095b198d15fd4de4d9bc2ec6b12c0b8c2e3 Mon Sep 17 00:00:00 2001 From: Oliver Freyermuth Date: Tue, 29 Aug 2023 21:55:35 +0200 Subject: [PATCH] stream/dvbin: do not forget channel list for multiply delivery systems dvb_get_channels is expected to append to an existing channel list. For adapters supporting many delivery systems, a subsequent channel list may turn up with a non-existent channel config, and the pointer to the previously parsed channel list may be lost (i.e. the list will be leaked and no channels detected). Fix this by passing through the existing list (which may be NULL) in case no new channels are found. --- stream/stream_dvb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream/stream_dvb.c b/stream/stream_dvb.c index dc70b43b19..e04bb73d06 100644 --- a/stream/stream_dvb.c +++ b/stream/stream_dvb.c @@ -262,7 +262,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log, char line[CHANNEL_LINE_LEN], *colon; if (!filename) - return NULL; + return list; int fields, cnt, k; int has8192, has0; @@ -283,7 +283,7 @@ static dvb_channels_list_t *dvb_get_channels(struct mp_log *log, filename, get_dvb_delsys(delsys)); if ((f = fopen(filename, "r")) == NULL) { mp_fatal(log, "CAN'T READ CONFIG FILE %s\n", filename); - return NULL; + return list; } if (list == NULL) {