From 8603ff480e7718efe9fa2882d427156b27c04ded Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Tue, 4 Jun 2024 15:03:51 +0200 Subject: [PATCH] hd-rum-decompress: fixed a leak on conference help CID 462474 \+ unchecked return value (CID 462475) --- src/hd-rum-translator/hd-rum-decompress.cpp | 13 ++++++++----- src/video_display/conference.cpp | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hd-rum-translator/hd-rum-decompress.cpp b/src/hd-rum-translator/hd-rum-decompress.cpp index 354ddf203..94b08c1cc 100644 --- a/src/hd-rum-translator/hd-rum-decompress.cpp +++ b/src/hd-rum-translator/hd-rum-decompress.cpp @@ -165,6 +165,14 @@ void state_transcoder_decompress::worker() void *hd_rum_decompress_init(struct module *parent, struct hd_rum_output_conf conf, const char *capture_filter, struct state_recompress *recompress) { + if (conf.mode == CONFERENCE && strcmp(conf.arg, "help") == 0) { + struct display *display = nullptr; + const int ret = initialize_video_display( + parent, "conference", "reflhelp", 0, nullptr, &display); + assert(ret == 1); + return nullptr; + } + struct state_transcoder_decompress *s; int force_ip_version = 0; @@ -185,11 +193,6 @@ void *hd_rum_decompress_init(struct module *parent, struct hd_rum_output_conf co ret = initialize_video_display(parent, "blend", cfg, 0, NULL, &s->display); break; case CONFERENCE: - if (strcmp(conf.arg, "help") == 0) { - initialize_video_display(parent, "conference", "reflhelp", 0, - nullptr, &s->display); - return nullptr; - } snprintf(cfg, sizeof cfg, "pipe:%p#%s", s, conf.arg); ret = initialize_video_display(parent, "conference", cfg, 0, NULL, &s->display); break; diff --git a/src/video_display/conference.cpp b/src/video_display/conference.cpp index 8845ea3a0..d5801da0b 100644 --- a/src/video_display/conference.cpp +++ b/src/video_display/conference.cpp @@ -475,7 +475,7 @@ static void *display_conference_init(struct module *parent, const char *fmt, uns if (strcmp(fmt, "reflhelp") == 0) { show_help(true); - return nullptr; + return INIT_NOERR; } if (isdigit(fmt[0])){ // fork