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