diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c index 971c861d0e..4e7e77c7cc 100644 --- a/libavfilter/af_aresample.c +++ b/libavfilter/af_aresample.c @@ -197,8 +197,11 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif ret = av_channel_layout_copy(&outsamplesref->ch_layout, &outlink->ch_layout); - if (ret < 0) + if (ret < 0) { + av_frame_free(&outsamplesref); + av_frame_free(&insamplesref); return ret; + } outsamplesref->sample_rate = outlink->sample_rate; if(insamplesref->pts != AV_NOPTS_VALUE) {