Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer <jamrial@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH] avcodec/codec_par: do not copy AVChannelLayout struct directly
Date: Tue, 15 Mar 2022 12:10:36 -0300
Message-ID: <63b43315-4bd0-f104-8ffc-a37f601b6c86@gmail.com> (raw)
In-Reply-To: <20220315142848.30527-1-cus@passwd.hu>

On 3/15/2022 11:28 AM, Marton Balint wrote:
> Later we use av_channel_layout_copy, but that uninits the struct
> unintentionally freeing the possibly allocated u.map pointer.
> 
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>   libavcodec/codec_par.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c
> index e4b329c838..abda649aa8 100644
> --- a/libavcodec/codec_par.c
> +++ b/libavcodec/codec_par.c
> @@ -78,6 +78,7 @@ int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src
>       codec_parameters_reset(dst);
>       memcpy(dst, src, sizeof(*dst));
>   
> +    dst->ch_layout      = (AVChannelLayout){0};
>       dst->extradata      = NULL;
>       dst->extradata_size = 0;
>       if (src->extradata) {

LGTM.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

      reply	other threads:[~2022-03-15 15:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-15 14:28 Marton Balint
2022-03-15 15:10 ` James Almer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63b43315-4bd0-f104-8ffc-a37f601b6c86@gmail.com \
    --to=jamrial@gmail.com \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git