Skip to content

Commit

Permalink
hd-rum-decompress: fixed a leak on conference help
Browse files Browse the repository at this point in the history
CID 462474

\+ unchecked return value (CID 462475)
  • Loading branch information
MartinPulec committed Jun 4, 2024
1 parent 1454e66 commit 8603ff4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/hd-rum-translator/hd-rum-decompress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/video_display/conference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8603ff4

Please sign in to comment.