1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/codec_par: do not copy AVChannelLayout struct directly

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>
This commit is contained in:
Marton Balint 2022-03-15 15:21:14 +01:00
parent 93a076db70
commit ef2b3efd51

View File

@ -78,6 +78,7 @@ int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src
codec_parameters_reset(dst); codec_parameters_reset(dst);
memcpy(dst, src, sizeof(*dst)); memcpy(dst, src, sizeof(*dst));
dst->ch_layout = (AVChannelLayout){0};
dst->extradata = NULL; dst->extradata = NULL;
dst->extradata_size = 0; dst->extradata_size = 0;
if (src->extradata) { if (src->extradata) {