On Tue, 30 Apr 2013, Anton Khirnov wrote:
Do not leak the x/y expressions. --- libavfilter/vf_crop.c | 2 ++ 1 file changed, 2 insertions(+)diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index ffb4c5b..01b6f98 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -195,6 +195,8 @@ static int config_input(AVFilterLink *link) s->w &= ~((1 << s->hsub) - 1); s->h &= ~((1 << s->vsub) - 1); + av_expr_free(s->x_pexpr); + av_expr_free(s->y_pexpr); if ((ret = av_expr_parse(&s->x_pexpr, s->x_expr, var_names, NULL, NULL, NULL, NULL, 0, ctx)) < 0 || (ret = av_expr_parse(&s->y_pexpr, s->y_expr, var_names, -- 1.7.10.4
This definitely needs setting to null inbetween. I didn't look if av_expr_parse sets the pointer to null if it fails, but even if it does (then the previous patch I commented on might be ok), but here, you could leave a dangling pointer in y_pexpr if parsing the x expression failed.
// Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
