From b7318d81f24aa011e49261c18f3d10fca17641bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:19:00 +0200 Subject: [PATCH 01/29] upipe_h264f: fix flow def leak on SPS read error --- lib/upipe-framers/upipe_h264_framer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-framers/upipe_h264_framer.c b/lib/upipe-framers/upipe_h264_framer.c index 5ef4cac69..18de94448 100644 --- a/lib/upipe-framers/upipe_h264_framer.c +++ b/lib/upipe-framers/upipe_h264_framer.c @@ -474,6 +474,7 @@ static bool upipe_h264f_activate_sps(struct upipe *upipe, uint32_t sps_id) struct ubuf_block_stream *s = &f.s; if (!ubase_check(ubuf_block_stream_init(s, upipe_h264f->sps[sps_id], 1))) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); + uref_free(flow_def); return false; } From d7d9b46cdb667aa14b535d8a8808c149089a5c7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:22:10 +0200 Subject: [PATCH 02/29] upipe_ablk: fix uref leak on ubuf dup failure --- lib/upipe-modules/upipe_audio_blank.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-modules/upipe_audio_blank.c b/lib/upipe-modules/upipe_audio_blank.c index 822d638aa..b11390f12 100644 --- a/lib/upipe-modules/upipe_audio_blank.c +++ b/lib/upipe-modules/upipe_audio_blank.c @@ -212,6 +212,7 @@ static void upipe_ablk_input(struct upipe *upipe, if (unlikely(!ubuf)) { upipe_err(upipe, "fail to duplicate blank buffer"); upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); + uref_free(uref); return; } From 415b6415c5cc093490a2b1ffd7785ebbdd6384a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:28:11 +0200 Subject: [PATCH 03/29] upipe_v210dec: fix flow def leak on alloc failure --- lib/upipe-v210/upipe_v210dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-v210/upipe_v210dec.c b/lib/upipe-v210/upipe_v210dec.c index 62e9bfa4d..bb0c8989d 100644 --- a/lib/upipe-v210/upipe_v210dec.c +++ b/lib/upipe-v210/upipe_v210dec.c @@ -589,6 +589,7 @@ static struct upipe *upipe_v210dec_alloc(struct upipe_mgr *manager, else { upipe_err(upipe, "unknown output format"); + uref_free(flow_def); upipe_v210dec_free_flow(upipe); return NULL; } From 32276f7576aaa8cd0e72cdf1215cbdd727fd0471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:33:09 +0200 Subject: [PATCH 04/29] upipe_glx_sink: close display without GLX support --- lib/upipe-gl/upipe_glx_sink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-gl/upipe_glx_sink.c b/lib/upipe-gl/upipe_glx_sink.c index 69df0b7a2..a4ed555f4 100644 --- a/lib/upipe-gl/upipe_glx_sink.c +++ b/lib/upipe-gl/upipe_glx_sink.c @@ -249,6 +249,7 @@ static int upipe_glx_sink_init_glx(struct upipe *upipe, int x, int y, int width, } if (!glXQueryExtension(display, &errorBase, &eventBase)) { upipe_err(upipe, "X server has no GLX extension"); + XCloseDisplay(display); return UBASE_ERR_EXTERNAL; } From c2858ffee84c96f0f4f203cc146d357fe67383d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:35:11 +0200 Subject: [PATCH 05/29] upipe_audiocont: fix double free of input name The previous input name was freed before duplicating the new one, but the pointer was left dangling if strdup failed, so it was used and freed again later. --- lib/upipe-modules/upipe_audiocont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upipe-modules/upipe_audiocont.c b/lib/upipe-modules/upipe_audiocont.c index 1152f88be..b72a019ee 100644 --- a/lib/upipe-modules/upipe_audiocont.c +++ b/lib/upipe-modules/upipe_audiocont.c @@ -778,7 +778,7 @@ static int _upipe_audiocont_set_input(struct upipe *upipe, const char *name) { struct upipe_audiocont *upipe_audiocont = upipe_audiocont_from_upipe(upipe); char *name_dup = NULL; - free(upipe_audiocont->input_name); + ubase_clean_str(&upipe_audiocont->input_name); if (name) { name_dup = strdup(name); From d73244b9de91816d4651cb9af5a631bd43216e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:36:04 +0200 Subject: [PATCH 06/29] upipe_auto_src: fix NULL deref on alloc failure --- lib/upipe-modules/upipe_auto_source.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/upipe-modules/upipe_auto_source.c b/lib/upipe-modules/upipe_auto_source.c index 949425667..91f45a22d 100644 --- a/lib/upipe-modules/upipe_auto_source.c +++ b/lib/upipe-modules/upipe_auto_source.c @@ -268,7 +268,6 @@ static struct upipe *upipe_auto_src_alloc(struct upipe_mgr *mgr, { struct upipe *upipe = upipe_auto_src_alloc_void(mgr, uprobe, signature, args); - upipe_auto_src_init_urefcount(upipe); if (unlikely(upipe == NULL)) return NULL; From 4fe7f0759861e8410781c0b269888615bbe48901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:37:21 +0200 Subject: [PATCH 07/29] upipe_multicat_sink: fix fsink leak on def error --- lib/upipe-modules/upipe_multicat_sink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-modules/upipe_multicat_sink.c b/lib/upipe-modules/upipe_multicat_sink.c index d958004ef..a2cbc71b7 100644 --- a/lib/upipe-modules/upipe_multicat_sink.c +++ b/lib/upipe-modules/upipe_multicat_sink.c @@ -155,6 +155,7 @@ static int _upipe_multicat_sink_output_alloc(struct upipe *upipe) (err = upipe_set_flow_def(fsink, upipe_multicat_sink->flow_def)) != UBASE_ERR_NONE) { upipe_warn(upipe, "set_flow_def failed"); + upipe_release(fsink); return err; } upipe_multicat_sink->fsink = fsink; From 849a9f57104e8c4e2dc8396dfa3879fd6685f6df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:38:53 +0200 Subject: [PATCH 08/29] upipe_rtp_mpeg4: fix AU header leak on resize --- lib/upipe-modules/upipe_rtp_mpeg4.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-modules/upipe_rtp_mpeg4.c b/lib/upipe-modules/upipe_rtp_mpeg4.c index ce99675fd..b2f21165a 100644 --- a/lib/upipe-modules/upipe_rtp_mpeg4.c +++ b/lib/upipe-modules/upipe_rtp_mpeg4.c @@ -132,6 +132,7 @@ static void upipe_rtp_mpeg4_input(struct upipe *upipe, struct uref *uref, if (!ubase_check(uref_block_truncate(uref, 7))) { upipe_err(upipe, "could not truncate uref"); + ubuf_free(au); uref_free(uref); return; } From 7fb0f2a1e7d51f49fdc71cd354ff2917016eb15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:41:12 +0200 Subject: [PATCH 09/29] upipe_rtpsrc: fix double free on rtpd alloc error The flow definition was freed once passed to setflowdef, then freed again on the error path if the rtpd inner pipe could not be allocated. --- lib/upipe-modules/upipe_rtp_source.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-modules/upipe_rtp_source.c b/lib/upipe-modules/upipe_rtp_source.c index e0cd6813d..2f582ac82 100644 --- a/lib/upipe-modules/upipe_rtp_source.c +++ b/lib/upipe-modules/upipe_rtp_source.c @@ -153,6 +153,7 @@ static struct upipe *upipe_rtpsrc_alloc(struct upipe_mgr *mgr, goto upipe_rtpsrc_alloc_err; upipe_setflowdef_set_dict(output, flow_def); uref_free(flow_def); + flow_def = NULL; } output = upipe_void_chain_output(output, From c87a27b89b4c4db2b02dbc92f21eec5a00dee191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:42:39 +0200 Subject: [PATCH 10/29] upipe_videocont: fix dangling input name If strdup fails, input_name still points to a freed string, which is then returned by get_input and freed again on the next set_input or when the pipe is freed. --- lib/upipe-modules/upipe_videocont.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upipe-modules/upipe_videocont.c b/lib/upipe-modules/upipe_videocont.c index 68febaa8a..91d1cbb31 100644 --- a/lib/upipe-modules/upipe_videocont.c +++ b/lib/upipe-modules/upipe_videocont.c @@ -577,7 +577,7 @@ static int _upipe_videocont_set_input(struct upipe *upipe, const char *name) { struct upipe_videocont *upipe_videocont = upipe_videocont_from_upipe(upipe); char *name_dup = NULL; - free(upipe_videocont->input_name); + ubase_clean_str(&upipe_videocont->input_name); if (name) { name_dup = strdup(name); From fe5b38c9437b05e8667eb787d5506e5b4eca8478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:46:17 +0200 Subject: [PATCH 11/29] https_source_hook_openssl: fix leak on BIO failure --- lib/upipe-openssl/https_source_hook_openssl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-openssl/https_source_hook_openssl.c b/lib/upipe-openssl/https_source_hook_openssl.c index c6e91e970..9d99090e7 100644 --- a/lib/upipe-openssl/https_source_hook_openssl.c +++ b/lib/upipe-openssl/https_source_hook_openssl.c @@ -273,6 +273,7 @@ struct upipe_http_src_hook *https_src_hook_openssl_alloc(struct uref *flow_def) BIO_free(wbio); SSL_free(ssl); SSL_CTX_free(ssl_ctx); + free(https); return NULL; } SSL_set_bio(ssl, rbio, wbio); From 8358b3d365e3549da3146964643f26de00df590a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:47:35 +0200 Subject: [PATCH 12/29] upipe_pthread_xfer: fix thread name leak on error --- lib/upipe-pthread/upipe_pthread_transfer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-pthread/upipe_pthread_transfer.c b/lib/upipe-pthread/upipe_pthread_transfer.c index 2ee213440..36e47010d 100644 --- a/lib/upipe-pthread/upipe_pthread_transfer.c +++ b/lib/upipe-pthread/upipe_pthread_transfer.c @@ -218,6 +218,7 @@ struct upipe_mgr *upipe_pthread_xfer_mgr_alloc_prio_named( return xfer_mgr; upipe_pthread_xfer_mgr_alloc_err5: + free(pthread_ctx->name); umutex_release(mutex); upipe_mgr_release(pthread_ctx->xfer_mgr); upipe_mgr_release(xfer_mgr); From fd561af2d930645be4ffe761d59fa6b7d30efe6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:49:17 +0200 Subject: [PATCH 13/29] upipe_swr: fix context leak on init failure --- lib/upipe-swresample/upipe_swr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-swresample/upipe_swr.c b/lib/upipe-swresample/upipe_swr.c index 404db5c55..e2f37e8d2 100644 --- a/lib/upipe-swresample/upipe_swr.c +++ b/lib/upipe-swresample/upipe_swr.c @@ -468,6 +468,7 @@ static struct upipe *upipe_swr_alloc(struct upipe_mgr *mgr, && upipe_swr->out_planes != 0 && (swr_init(upipe_swr->swr) < 0)) { upipe_err_va(upipe, "failed to init swresample with format %s", def); + swr_free(&upipe_swr->swr); uref_free(flow_def); upipe_swr_free_flow(upipe); return NULL; From 3aae8325bb8e8a7bf466b6e258af945cab2571af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:51:52 +0200 Subject: [PATCH 14/29] upipe_sws_thumbs: fix dangling gallery on ENOMEM When the gallery picture buffer could not be allocated, the duplicated gallery uref was freed but the pipe kept a pointer to it, which was then used by the next picture and freed again in upipe_sws_thumbs_free. --- lib/upipe-swscale/upipe_sws_thumbs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-swscale/upipe_sws_thumbs.c b/lib/upipe-swscale/upipe_sws_thumbs.c index e02f9c7b2..ff515f14b 100644 --- a/lib/upipe-swscale/upipe_sws_thumbs.c +++ b/lib/upipe-swscale/upipe_sws_thumbs.c @@ -265,6 +265,7 @@ static bool upipe_sws_thumbs_handle(struct upipe *upipe, struct uref *uref, thumbsize->vsize * thumbnum->vsize); if (unlikely(!ubuf)) { uref_free(gallery); + upipe_sws_thumbs->gallery = NULL; uref_free(uref); upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); return true; From 778de7fd57bcb3bc8e9b3a4d4a2b6d3bfa8b0ec8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:53:34 +0200 Subject: [PATCH 15/29] upipe_ts_demux: fix psi_split leak on def error --- lib/upipe-ts/upipe_ts_demux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-ts/upipe_ts_demux.c b/lib/upipe-ts/upipe_ts_demux.c index 3dec24268..1cd567fcc 100644 --- a/lib/upipe-ts/upipe_ts_demux.c +++ b/lib/upipe-ts/upipe_ts_demux.c @@ -641,6 +641,7 @@ static struct upipe_ts_demux_psi_pid * flow_def)))) { if (flow_def != NULL) uref_free(flow_def); + upipe_release(psi_pid->psi_split); free(psi_pid); return NULL; } From 14e6dadc4111a35a7ad48e68b51c0b863e0c30d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 18:59:50 +0200 Subject: [PATCH 16/29] upipe_avcenc: fix flow def leak on alloc failure --- lib/upipe-av/upipe_avcodec_encode.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-av/upipe_avcodec_encode.c b/lib/upipe-av/upipe_avcodec_encode.c index ed9a67c81..eccb8a63e 100644 --- a/lib/upipe-av/upipe_avcodec_encode.c +++ b/lib/upipe-av/upipe_avcodec_encode.c @@ -2188,6 +2188,7 @@ static struct upipe *upipe_avcenc_alloc(struct upipe_mgr *mgr, struct uref *options = uref_alloc_control(flow_def->mgr); if (options == NULL) { + uref_free(flow_def); av_frame_free(&frame); av_packet_free(&avpkt); upipe_avcenc_free_flow(upipe); From 24a87087e4712b552d37b8fdce4e0e70d579219e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:01:41 +0200 Subject: [PATCH 17/29] upipe_dvbsrc: check flow format allocation --- lib/upipe-dvb/upipe_dvbsrc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upipe-dvb/upipe_dvbsrc.c b/lib/upipe-dvb/upipe_dvbsrc.c index f08710591..18b2edf25 100644 --- a/lib/upipe-dvb/upipe_dvbsrc.c +++ b/lib/upipe-dvb/upipe_dvbsrc.c @@ -250,11 +250,11 @@ static int upipe_dvbsrc_check(struct upipe *upipe, struct uref *flow_format) if (upipe_dvbsrc->ubuf_mgr == NULL) { struct uref *flow_format = uref_block_flow_alloc_def(upipe_dvbsrc->uref_mgr, NULL); - uref_block_flow_set_size(flow_format, MTU); if (unlikely(flow_format == NULL)) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); return UBASE_ERR_ALLOC; } + uref_block_flow_set_size(flow_format, MTU); upipe_dvbsrc_require_ubuf_mgr(upipe, flow_format); return UBASE_ERR_NONE; } From b09ba403a24da075a2f575c852c920341801fb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:02:28 +0200 Subject: [PATCH 18/29] upipe_dveo_asi_src: check flow format allocation --- lib/upipe-dveo/upipe_dveo_asi_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upipe-dveo/upipe_dveo_asi_source.c b/lib/upipe-dveo/upipe_dveo_asi_source.c index f6c37b626..30ba7efcc 100644 --- a/lib/upipe-dveo/upipe_dveo_asi_source.c +++ b/lib/upipe-dveo/upipe_dveo_asi_source.c @@ -294,11 +294,11 @@ static int upipe_dveo_asi_src_check(struct upipe *upipe, struct uref *flow_forma if (upipe_dveo_asi_src->ubuf_mgr == NULL) { struct uref *flow_format = uref_block_flow_alloc_def(upipe_dveo_asi_src->uref_mgr, NULL); - uref_block_flow_set_size(flow_format, CAPTURE_DEFAULT_SIZE); if (unlikely(flow_format == NULL)) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); return UBASE_ERR_ALLOC; } + uref_block_flow_set_size(flow_format, CAPTURE_DEFAULT_SIZE); upipe_dveo_asi_src_require_ubuf_mgr(upipe, flow_format); return UBASE_ERR_NONE; } From 14e6d5762524494a8f4c8950bcf824514a27c753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:04:04 +0200 Subject: [PATCH 19/29] upipe_pack10bit: fix output leak on read failure --- lib/upipe-hbrmt/upipe_pack10bit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-hbrmt/upipe_pack10bit.c b/lib/upipe-hbrmt/upipe_pack10bit.c index 723ebd80c..4fdce4733 100644 --- a/lib/upipe-hbrmt/upipe_pack10bit.c +++ b/lib/upipe-hbrmt/upipe_pack10bit.c @@ -134,6 +134,8 @@ static bool upipe_pack10bit_handle(struct upipe *upipe, struct uref *uref, int buf_size = -1; /* Map input buffer. */ if (unlikely(!ubase_check(uref_block_read(uref, input_offset, &buf_size, &src)))) { + ubuf_block_unmap(ubuf_dst, 0); + ubuf_free(ubuf_dst); uref_free(uref); upipe_throw_fatal(upipe, UBASE_ERR_INVALID); return true; From e0588c735d5962a1dc65158cd4894f3d2016847b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:05:44 +0200 Subject: [PATCH 20/29] upipe-hls: check aes decrypt pipe before padding --- lib/upipe-hls/upipe_hls_audio.c | 2 +- lib/upipe-hls/upipe_hls_void.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/upipe-hls/upipe_hls_audio.c b/lib/upipe-hls/upipe_hls_audio.c index 1935c4d14..26fceaedf 100644 --- a/lib/upipe-hls/upipe_hls_audio.c +++ b/lib/upipe-hls/upipe_hls_audio.c @@ -469,9 +469,9 @@ static int probe_playlist(struct uprobe *uprobe, struct upipe *inner, uprobe_pfx_alloc( uprobe_use(&upipe_hls_audio->probe_aes_decrypt), UPROBE_LOG_VERBOSE, "aes decrypt")); - upipe_aes_decrypt_set_padding(output, UPIPE_AES_DECRYPT_PADDING_PKCS7); upipe_mgr_release(upipe_aes_decrypt_mgr); UBASE_ALLOC_RETURN(output); + upipe_aes_decrypt_set_padding(output, UPIPE_AES_DECRYPT_PADDING_PKCS7); /** guess playlist type (AAC or TS) */ struct upipe_mgr *upipe_probe_uref_mgr = upipe_probe_uref_mgr_alloc(); diff --git a/lib/upipe-hls/upipe_hls_void.c b/lib/upipe-hls/upipe_hls_void.c index f66d2e07c..6e427a280 100644 --- a/lib/upipe-hls/upipe_hls_void.c +++ b/lib/upipe-hls/upipe_hls_void.c @@ -367,9 +367,9 @@ static int probe_playlist(struct uprobe *uprobe, struct upipe *inner, uprobe_pfx_alloc( uprobe_use(&upipe_hls_void->probe_aes_decrypt), UPROBE_LOG_VERBOSE, "aes decrypt")); - upipe_aes_decrypt_set_padding(output, UPIPE_AES_DECRYPT_PADDING_PKCS7); upipe_mgr_release(upipe_aes_decrypt_mgr); UBASE_ALLOC_RETURN(output); + upipe_aes_decrypt_set_padding(output, UPIPE_AES_DECRYPT_PADDING_PKCS7); /* ts demux */ From 20736c8d99bd8187aac9b73afb210cfe8b1e9025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:07:17 +0200 Subject: [PATCH 21/29] upipe_audio_split: fix flow def leak on sub error --- lib/upipe-modules/upipe_audio_split.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/upipe-modules/upipe_audio_split.c b/lib/upipe-modules/upipe_audio_split.c index a04d53821..3dca000c2 100644 --- a/lib/upipe-modules/upipe_audio_split.c +++ b/lib/upipe-modules/upipe_audio_split.c @@ -152,6 +152,7 @@ static struct upipe *upipe_audio_split_sub_alloc(struct upipe_mgr *mgr, &sub->planes)) || !ubase_check(uref_sound_flow_get_channels(flow_def, &sub->channels)))) { + uref_free(flow_def); upipe_clean(upipe); free(sub); return NULL; From 8b0320a1ed29b7b131d9b32e4c902f1cf7b76106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:08:31 +0200 Subject: [PATCH 22/29] upipe_dump: check allocation failure --- lib/upipe-modules/upipe_dump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-modules/upipe_dump.c b/lib/upipe-modules/upipe_dump.c index 7379072d6..41856d4f4 100644 --- a/lib/upipe-modules/upipe_dump.c +++ b/lib/upipe-modules/upipe_dump.c @@ -57,6 +57,8 @@ static struct upipe *upipe_dump_alloc(struct upipe_mgr *mgr, va_list args) { struct upipe *upipe = upipe_dump_alloc_void(mgr, uprobe, signature, args); + if (unlikely(upipe == NULL)) + return NULL; upipe_dump_init_urefcount(upipe); upipe_dump_init_output(upipe); From a4738c7cd30197c418741391a0dac6851ace2ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:09:01 +0200 Subject: [PATCH 23/29] upipe_m3u_reader: check allocation failure --- lib/upipe-modules/upipe_m3u_reader.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-modules/upipe_m3u_reader.c b/lib/upipe-modules/upipe_m3u_reader.c index 260380309..6ef33c3be 100644 --- a/lib/upipe-modules/upipe_m3u_reader.c +++ b/lib/upipe-modules/upipe_m3u_reader.c @@ -236,6 +236,8 @@ static struct upipe *upipe_m3u_reader_alloc(struct upipe_mgr *mgr, { struct upipe *upipe = upipe_m3u_reader_alloc_void(mgr, uprobe, signature, args); + if (unlikely(upipe == NULL)) + return NULL; upipe_m3u_reader_init_urefcount(upipe); upipe_m3u_reader_init_output(upipe); From ef4b674d463b02dd1f29f090522a81f6356cc15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:10:19 +0200 Subject: [PATCH 24/29] upipe_msrc: fix fd leak on invalid aux segment --- lib/upipe-modules/upipe_multicat_source.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-modules/upipe_multicat_source.c b/lib/upipe-modules/upipe_multicat_source.c index 657c5a4fa..efe2fb4fc 100644 --- a/lib/upipe-modules/upipe_multicat_source.c +++ b/lib/upipe-modules/upipe_multicat_source.c @@ -271,6 +271,7 @@ static int upipe_msrc_start(struct upipe *upipe) if (unlikely(fstat(fd, &aux_stat) == -1 || aux_stat.st_size < sizeof(uint64_t))) { upipe_warn_va(upipe, "invalid segment %"PRIu64, upipe_msrc->fileidx); + close(fd); /* try next file anyway */ return upipe_msrc_skip(upipe); } @@ -280,6 +281,7 @@ static int upipe_msrc_start(struct upipe *upipe) if (unlikely(aux_buf == MAP_FAILED)) { upipe_err_va(upipe, "unable to mmap segment %"PRIu64, upipe_msrc->fileidx); + close(fd); return UBASE_ERR_EXTERNAL; } From db08b396347c5085cef2b665a74266255088d098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:12:04 +0200 Subject: [PATCH 25/29] upipe_sinesrc: fix NULL deref on alloc failure --- lib/upipe-modules/upipe_sine_wave_source.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-modules/upipe_sine_wave_source.c b/lib/upipe-modules/upipe_sine_wave_source.c index a0abbd9f2..fba6f72b3 100644 --- a/lib/upipe-modules/upipe_sine_wave_source.c +++ b/lib/upipe-modules/upipe_sine_wave_source.c @@ -127,6 +127,8 @@ static struct upipe *upipe_sinesrc_alloc(struct upipe_mgr *mgr, va_list args) { struct upipe *upipe = upipe_sinesrc_alloc_void(mgr, uprobe, signature, args); + if (unlikely(upipe == NULL)) + return NULL; struct upipe_sinesrc *upipe_sinesrc = upipe_sinesrc_from_upipe(upipe); upipe_sinesrc_init_urefcount(upipe); upipe_sinesrc_init_uref_mgr(upipe); From 9f893eb60db4d8156c92068e52be9f3c1de75649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:12:59 +0200 Subject: [PATCH 26/29] upipe_netmap_source: check the pipe allocation --- lib/upipe-netmap/upipe_netmap_source.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-netmap/upipe_netmap_source.c b/lib/upipe-netmap/upipe_netmap_source.c index eb9c25af8..2044253b9 100644 --- a/lib/upipe-netmap/upipe_netmap_source.c +++ b/lib/upipe-netmap/upipe_netmap_source.c @@ -130,6 +130,8 @@ static struct upipe *upipe_netmap_source_alloc(struct upipe_mgr *mgr, uint32_t signature, va_list args) { struct upipe *upipe = upipe_netmap_source_alloc_void(mgr, uprobe, signature, args); + if (unlikely(upipe == NULL)) + return NULL; struct upipe_netmap_source *upipe_netmap_source = upipe_netmap_source_from_upipe(upipe); upipe_netmap_source_init_urefcount(upipe); upipe_netmap_source_init_uref_mgr(upipe); From b9d88065695a373515995094621b0881fb7a0b15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:14:42 +0200 Subject: [PATCH 27/29] upipe_ts_scte104d: fix uref leak on invalid isdrd --- lib/upipe-ts/upipe_ts_scte104_decoder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/upipe-ts/upipe_ts_scte104_decoder.c b/lib/upipe-ts/upipe_ts_scte104_decoder.c index fdc1d82c0..eb039a959 100644 --- a/lib/upipe-ts/upipe_ts_scte104_decoder.c +++ b/lib/upipe-ts/upipe_ts_scte104_decoder.c @@ -524,6 +524,7 @@ upipe_ts_scte104d_insert_segmentation_descriptor(struct upipe *upipe, uint16_t data_length = scte104o_get_data_length(op); if (data_length < SCTE104ISDRD_HEADER_SIZE) { upipe_warn(upipe, "drop invalid isdrd"); + uref_free(desc); return UBASE_ERR_INVALID; } const uint8_t *data = scte104o_get_data(op); @@ -534,6 +535,7 @@ upipe_ts_scte104d_insert_segmentation_descriptor(struct upipe *upipe, uint8_t upid_length = scte104isdrd_get_upid_length(data); if (data_length < SCTE104ISDRD_HEADER_SIZE + upid_length) { upipe_warn(upipe, "drop invalid isdrd"); + uref_free(desc); return UBASE_ERR_INVALID; } uint8_t *upid = scte104isdrd_get_upid(data); From ef12c33d6929af69b03bff0605c79853872332c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:18:35 +0200 Subject: [PATCH 28/29] upipe_vanc: fix probe leaks on allocation failure --- lib/upipe-filters/upipe_filter_vanc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/upipe-filters/upipe_filter_vanc.c b/lib/upipe-filters/upipe_filter_vanc.c index f965c728b..c37bd6cbf 100644 --- a/lib/upipe-filters/upipe_filter_vanc.c +++ b/lib/upipe-filters/upipe_filter_vanc.c @@ -374,6 +374,9 @@ static struct upipe *_upipe_vanc_alloc(struct upipe_mgr *mgr, struct upipe_vanc *upipe_vanc = malloc(sizeof(struct upipe_vanc)); if (unlikely(upipe_vanc == NULL)) { + uprobe_release(uprobe); + uprobe_release(uprobe_afd); + uprobe_release(uprobe_scte104); uprobe_release(uprobe_op47); uprobe_release(uprobe_cea708); uprobe_release(uprobe_st2031); From 6ffe1b37015b1a0801e89b5483dae0b423319a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Vasseur?= Date: Tue, 6 Oct 2026 19:25:44 +0200 Subject: [PATCH 29/29] upipe_udpsrc: check flow format allocation --- lib/upipe-modules/upipe_udp_source.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upipe-modules/upipe_udp_source.c b/lib/upipe-modules/upipe_udp_source.c index c34c3fc7f..8956f1031 100644 --- a/lib/upipe-modules/upipe_udp_source.c +++ b/lib/upipe-modules/upipe_udp_source.c @@ -260,11 +260,11 @@ static int upipe_udpsrc_check(struct upipe *upipe, struct uref *flow_format) if (upipe_udpsrc->ubuf_mgr == NULL) { struct uref *flow_format = uref_block_flow_alloc_def(upipe_udpsrc->uref_mgr, NULL); - uref_block_flow_set_size(flow_format, upipe_udpsrc->output_size); if (unlikely(flow_format == NULL)) { upipe_throw_fatal(upipe, UBASE_ERR_ALLOC); return UBASE_ERR_ALLOC; } + uref_block_flow_set_size(flow_format, upipe_udpsrc->output_size); upipe_udpsrc_require_ubuf_mgr(upipe, flow_format); return UBASE_ERR_NONE; }