[FFmpeg-cvslog] avutil/opt: add missing case for AV_OPT_TYPE_CHLAYOUT in av_opt_free()

James Almer git at videolan.org
Sat Mar 19 00:00:17 EET 2022


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 18 18:46:40 2022 -0300| [327efa66331ebdc0087c6b656059a8df2f404019] | committer: James Almer

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 <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=327efa66331ebdc0087c6b656059a8df2f404019
---

 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;
         }



More information about the ffmpeg-cvslog mailing list