[FFmpeg-devel] [PATCH 01/17] avcodec/avcodec: Uninitialize AVChannelLayout before overwriting it

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Wed Sep 21 01:15:05 EEST 2022


Andreas Rheinhardt:
> Otherwise, there might be leaks.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> ---
>  libavcodec/avcodec.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
> index 29643199be..a165cdea95 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 {

Will apply this patchset tomorrow unless there are objections.

- Andreas


More information about the ffmpeg-devel mailing list