Skip to content

Commit b6ca11c

Browse files
quariumcmassiot
authored andcommitted
upipe_avcdec: fix memory leak
1 parent bffc400 commit b6ca11c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/upipe-av/upipe_avcodec_decode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (C) 2012-2015 OpenHeadend S.A.R.L.
3+
* Copyright (C) 2025 EasyTools
34
*
45
* Authors: Benjamin Cohen
56
* Christophe Massiot
@@ -470,9 +471,11 @@ static int upipe_avcdec_get_buffer_pic(struct AVCodecContext *context,
470471
!(context->codec->capabilities & AV_CODEC_CAP_DR1);
471472

472473
if (unlikely(upipe_avcdec->ubuf_mgr == NULL)) {
474+
uref_free(upipe_avcdec->flow_def_format);
473475
upipe_avcdec->flow_def_format = uref_dup(flow_def_attr);
474476
if (use_ubuf_av) {
475477
upipe_avcdec->ubuf_mgr = ubuf_av_mgr_alloc();
478+
uref_free(upipe_avcdec->flow_def_provided);
476479
upipe_avcdec->flow_def_provided = flow_def_attr;
477480
if (upipe_avcdec->ubuf_mgr == NULL) {
478481
uref_free(uref);

0 commit comments

Comments
 (0)