MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / parse_expr

Function parse_expr

libavutil/eval.c:664–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

662}
663
664static int parse_expr(AVExpr **e, Parser *p)
665{
666 int ret;
667 AVExpr *e0, *e1, *e2;
668 if (p->stack_index <= 0) //protect against stack overflows
669 return AVERROR(EINVAL);
670 p->stack_index--;
671
672 if ((ret = parse_subexpr(&e0, p)) < 0)
673 return ret;
674 while (*p->s == ';') {
675 p->s++;
676 e1 = e0;
677 if ((ret = parse_subexpr(&e2, p)) < 0) {
678 av_expr_free(e1);
679 return ret;
680 }
681 e0 = make_eval_expr(e_last, 1, e1, e2);
682 if (!e0) {
683 av_expr_free(e1);
684 av_expr_free(e2);
685 return AVERROR(ENOMEM);
686 }
687 };
688
689 p->stack_index++;
690 *e = e0;
691 return 0;
692}
693
694static int verify_expr(AVExpr *e)
695{

Callers 2

parse_primaryFunction · 0.70
av_expr_parseFunction · 0.70

Calls 3

parse_subexprFunction · 0.85
av_expr_freeFunction · 0.85
make_eval_exprFunction · 0.85

Tested by

no test coverage detected