diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-18 21:33:27 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-09-22 00:30:32 +0200 |
commit | e2e31815191254ef5581213639f4bed8e4a8be25 (patch) | |
tree | b0310421faeeb76eac3c23833f1b7b1a7235fb0c /libavcodec/avcodec.c | |
parent | 9beba053117342dd7619b009c2f87eed77725807 (diff) | |
download | ffmpeg-e2e31815191254ef5581213639f4bed8e4a8be25.tar.gz |
avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it
Otherwise, there might be leaks.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/avcodec.c')
-rw-r--r-- | libavcodec/avcodec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c index 1f8ab37abb..81f30a4a58 100644 --- a/libavcodec/avcodec.c +++ b/libavcodec/avcodec.c @@ -235,6 +235,7 @@ FF_DISABLE_DEPRECATION_WARNINGS if ((avctx->channels > 0 && avctx->ch_layout.nb_channels != avctx->channels) || (avctx->channel_layout && (avctx->ch_layout.order != AV_CHANNEL_ORDER_NATIVE || avctx->ch_layout.u.mask != avctx->channel_layout))) { + av_channel_layout_uninit(&avctx->ch_layout); if (avctx->channel_layout) { av_channel_layout_from_mask(&avctx->ch_layout, avctx->channel_layout); } else { |