Later we use av_channel_layout_copy, but that uninits the struct unintentionally freeing the possibly allocated u.map pointer.
Showing the changes to libavcodec/codec_par.c (1 of 1 file). Show all
Unified · Split
| @@ -78,6 +78,7 @@ int avcodec_parameters_copy(AVCodecParameters *dst, const AVCodecParameters *src · 77 unmodified lines | |||
| 78 | codec_parameters_reset(dst); | 78 | codec_parameters_reset(dst); |
| 79 | memcpy(dst, src, sizeof(*dst)); | 79 | memcpy(dst, src, sizeof(*dst)); |
| 80 | 80 | ||
| 81 | dst->ch_layout = (AVChannelLayout){0}; | ||
| 81 | dst->extradata = NULL; | 82 | dst->extradata = NULL; |
| 82 | dst->extradata_size = 0; | 83 | dst->extradata_size = 0; |
| 83 | if (src->extradata) { | 84 | if (src->extradata) { |