From 327efa66331ebdc0087c6b656059a8df2f404019 Mon Sep 17 00:00:00 2001 From: James Almer Date: Fri, 18 Mar 2022 18:46:40 -0300 Subject: [PATCH] avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free() Fixes potential memleaks for existing options of this type. Signed-off-by: James Almer --- libavutil/opt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavutil/opt.c b/libavutil/opt.c index 445537fbad..8ffb10449b 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -1729,6 +1729,10 @@ void av_opt_free(void *obj) av_dict_free((AVDictionary **)(((uint8_t *)obj) + o->offset)); break; + case AV_OPT_TYPE_CHLAYOUT: + av_channel_layout_uninit((AVChannelLayout *)(((uint8_t *)obj) + o->offset)); + break; + default: break; }