[FFmpeg-devel] [PATCHv2 1/4] avfilter/all: check and propagate the return code of av_expr_parse_and_eval
Nicolas George
george at nsup.org
Sun Nov 1 21:45:12 CET 2015
Le primidi 11 brumaire, an CCXXIV, Ganesh Ajjanagadde a écrit :
> This function can return ENOMEM that needs to be propagated.
>
> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde at gmail.com>
> ---
> libavfilter/vf_pad.c | 12 +++++++-----
> libavfilter/vf_rotate.c | 5 +++--
> libavfilter/vf_scale.c | 5 +++--
> libavfilter/vf_zscale.c | 5 +++--
> 4 files changed, 16 insertions(+), 11 deletions(-)
>
> diff --git a/libavfilter/vf_pad.c b/libavfilter/vf_pad.c
> index 63dc6a8..a40f5fa 100644
> --- a/libavfilter/vf_pad.c
> +++ b/libavfilter/vf_pad.c
> @@ -114,9 +114,10 @@ static int config_input(AVFilterLink *inlink)
> var_values[VAR_VSUB] = 1 << s->draw.vsub_max;
>
> /* evaluate width and height */
> - av_expr_parse_and_eval(&res, (expr = s->w_expr),
> + if ((ret = av_expr_parse_and_eval(&res, (expr = s->w_expr),
> var_names, var_values,
> - NULL, NULL, NULL, NULL, NULL, 0, ctx);
> + NULL, NULL, NULL, NULL, NULL, 0, ctx)) == AVERROR(ENOMEM))
> + goto eval_fail;
I am quite unhappy about this, it is cluttering the code for no good reason
and makes the test fragile.
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151101/3edecb7b/attachment.sig>
More information about the ffmpeg-devel
mailing list