summaryrefslogtreecommitdiff
path: root/libavutil/eval.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-01 09:34:12 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-11-01 09:34:12 +0000
commit63b1630356f41c1de164aa98ad6ae16db8411a21 (patch)
treefb1b47ced7dfcef18cef14b8da3fa042551e7dc3 /libavutil/eval.c
parentd56920e206b639d9e2a4e22b90acc680c6e4ca04 (diff)
Fix evaluation of expressions of the form: E1;E2.
The pointer to the char ';' has to be increased before to evaluate ";E2". Originally committed as revision 25623 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/eval.c')
-rw-r--r--libavutil/eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/eval.c b/libavutil/eval.c
index 6e0349872b..c1a0539ecd 100644
--- a/libavutil/eval.c
+++ b/libavutil/eval.c
@@ -404,12 +404,12 @@ static int parse_expr(AVExpr **e, Parser *p)
if ((ret = parse_subexpr(&e0, p)) < 0)
return ret;
while (*p->s == ';') {
+ p->s++;
e1 = e0;
if ((ret = parse_subexpr(&e2, p)) < 0) {
av_free_expr(e1);
return ret;
}
- p->s++;
e0 = new_eval_expr(e_last, 1, e1, e2);
if (!e0) {
av_free_expr(e1);
@@ -534,6 +534,7 @@ int main(void)
double d;
const char **expr, *exprs[] = {
"",
+ "1;2",
"1+(5-2)^(3-1)+1/2+sin(PI)-max(-2.2,-3.1)",
"80G/80Gi"
"1k",