23e3e7f0f0bf9ac76f8661872f27974f33280f95
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / ffmpeg-4.1.4.patch4
1 --- a/libavfilter/af_aformat.c  2018-07-17 03:27:41.000000000 -0600
2 +++ b/libavfilter/af_aformat.c  2019-03-16 17:55:28.449442750 -0600
3 @@ -109,6 +109,16 @@
4      return 0;
5  }
6  
7 +#define DEL_FIELD(p,mem,fld) if( p->mem ) { av_freep(&p->mem->fld); av_freep(&p->mem); }
8 +
9 +static av_cold void uninit(AVFilterContext *ctx)
10 +{
11 +    AFormatContext *s = ctx->priv;
12 +    DEL_FIELD(s, formats, formats);
13 +    DEL_FIELD(s, sample_rates, formats);
14 +    DEL_FIELD(s, channel_layouts, channel_layouts);
15 +}
16 +
17  static int query_formats(AVFilterContext *ctx)
18  {
19      AFormatContext *s = ctx->priv;
20 @@ -146,6 +156,7 @@
21      .name          = "aformat",
22      .description   = NULL_IF_CONFIG_SMALL("Convert the input audio to one of the specified formats."),
23      .init          = init,
24 +    .uninit        = uninit,
25      .query_formats = query_formats,
26      .priv_size     = sizeof(AFormatContext),
27      .priv_class    = &aformat_class,