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>
release/5.1
Marton Balint 3 years ago
parent 93a076db70
commit ef2b3efd51
  1. 1
      libavcodec/codec_par.c

@ -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) {

Loading…
Cancel
Save