Commit 05c1f78a authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

avfilter/aeval: Fix leak of expressions upon reallocation error

Fix this by switching to av_dynarray_add_nofree() which is more
natural anyway because the entries of the array are pointers.
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
parent bae96fa9
......@@ -124,11 +124,10 @@ static int parse_channel_expressions(AVFilterContext *ctx,
}
#define ADD_EXPRESSION(expr_) do { \
if (!av_dynarray2_add((void **)&eval->expr, &eval->nb_channels, \
sizeof(*eval->expr), NULL)) { \
ret = AVERROR(ENOMEM); \
ret = av_dynarray_add_nofree(&eval->expr, \
&eval->nb_channels, NULL); \
if (ret < 0) \
goto end; \
} \
eval->expr[eval->nb_channels-1] = NULL; \
ret = av_expr_parse(&eval->expr[eval->nb_channels - 1], expr_, \
var_names, func1_names, func1, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment