1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

lavfi/avfiltergraph: fix leak on error

Introduced in eddffbedb3

Fixes: CID1618897 Resource leak
Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Marvin Scholz 2024-09-05 03:13:13 +02:00 committed by Anton Khirnov
parent fe4b9ef69f
commit 9556379943

View File

@ -372,8 +372,10 @@ static int filter_query_formats(AVFilterContext *ctx)
if (ctx->nb_outputs > FF_ARRAY_ELEMS(cfg_out_stack)) {
cfg_out_dyn = av_malloc_array(ctx->nb_outputs, sizeof(*cfg_out_dyn));
if (!cfg_out_dyn)
if (!cfg_out_dyn) {
av_freep(&cfg_in_dyn);
return AVERROR(ENOMEM);
}
cfg_out = cfg_out_dyn;
} else
cfg_out = ctx->nb_outputs ? cfg_out_stack : NULL;