Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b7318d8
upipe_h264f: fix flow def leak on SPS read error
nto Oct 6, 2026
d7d9b46
upipe_ablk: fix uref leak on ubuf dup failure
nto Oct 6, 2026
415b641
upipe_v210dec: fix flow def leak on alloc failure
nto Oct 6, 2026
32276f7
upipe_glx_sink: close display without GLX support
nto Oct 6, 2026
c2858ff
upipe_audiocont: fix double free of input name
nto Oct 6, 2026
d73244b
upipe_auto_src: fix NULL deref on alloc failure
nto Oct 6, 2026
4fe7f07
upipe_multicat_sink: fix fsink leak on def error
nto Oct 6, 2026
849a9f5
upipe_rtp_mpeg4: fix AU header leak on resize
nto Oct 6, 2026
7fb0f2a
upipe_rtpsrc: fix double free on rtpd alloc error
nto Oct 6, 2026
c87a27b
upipe_videocont: fix dangling input name
nto Oct 6, 2026
fe5b38c
https_source_hook_openssl: fix leak on BIO failure
nto Oct 6, 2026
8358b3d
upipe_pthread_xfer: fix thread name leak on error
nto Oct 6, 2026
fd561af
upipe_swr: fix context leak on init failure
nto Oct 6, 2026
3aae832
upipe_sws_thumbs: fix dangling gallery on ENOMEM
nto Oct 6, 2026
778de7f
upipe_ts_demux: fix psi_split leak on def error
nto Oct 6, 2026
14e6dad
upipe_avcenc: fix flow def leak on alloc failure
nto Oct 6, 2026
24a8708
upipe_dvbsrc: check flow format allocation
nto Oct 6, 2026
b09ba40
upipe_dveo_asi_src: check flow format allocation
nto Oct 6, 2026
14e6d57
upipe_pack10bit: fix output leak on read failure
nto Oct 6, 2026
e0588c7
upipe-hls: check aes decrypt pipe before padding
nto Oct 6, 2026
20736c8
upipe_audio_split: fix flow def leak on sub error
nto Oct 6, 2026
8b0320a
upipe_dump: check allocation failure
nto Oct 6, 2026
a4738c7
upipe_m3u_reader: check allocation failure
nto Oct 6, 2026
ef4b674
upipe_msrc: fix fd leak on invalid aux segment
nto Oct 6, 2026
db08b39
upipe_sinesrc: fix NULL deref on alloc failure
nto Oct 6, 2026
9f893eb
upipe_netmap_source: check the pipe allocation
nto Oct 6, 2026
b9d8806
upipe_ts_scte104d: fix uref leak on invalid isdrd
nto Oct 6, 2026
ef12c33
upipe_vanc: fix probe leaks on allocation failure
nto Oct 6, 2026
6ffe1b3
upipe_udpsrc: check flow format allocation
nto Oct 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/upipe-av/upipe_avcodec_encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-dvb/upipe_dvbsrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-dveo/upipe_dveo_asi_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions lib/upipe-filters/upipe_filter_vanc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-framers/upipe_h264_framer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions lib/upipe-gl/upipe_glx_sink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-hbrmt/upipe_pack10bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-hls/upipe_hls_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-hls/upipe_hls_void.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-modules/upipe_audio_blank.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions lib/upipe-modules/upipe_audio_split.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-modules/upipe_audiocont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion lib/upipe-modules/upipe_auto_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-modules/upipe_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-modules/upipe_m3u_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-modules/upipe_multicat_sink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-modules/upipe_multicat_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions lib/upipe-modules/upipe_rtp_mpeg4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-modules/upipe_rtp_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-modules/upipe_sine_wave_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-modules/upipe_udp_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/upipe-modules/upipe_videocont.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-netmap/upipe_netmap_source.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-openssl/https_source_hook_openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-pthread/upipe_pthread_transfer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-swresample/upipe_swr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-swscale/upipe_sws_thumbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-ts/upipe_ts_demux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions lib/upipe-ts/upipe_ts_scte104_decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-v210/upipe_v210dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading