Commit 40b6319e authored by stefano's avatar stefano

Improve av_parse_eval() error reporting.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23627 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 641ec5ed
...@@ -182,7 +182,7 @@ void av_free_expr(AVExpr *e) ...@@ -182,7 +182,7 @@ void av_free_expr(AVExpr *e)
static int parse_primary(AVExpr **e, Parser *p) static int parse_primary(AVExpr **e, Parser *p)
{ {
AVExpr *d = av_mallocz(sizeof(AVExpr)); AVExpr *d = av_mallocz(sizeof(AVExpr));
char *next= p->s; char *next = p->s, *s0 = p->s;
int ret, i; int ret, i;
if (!d) if (!d)
...@@ -211,7 +211,7 @@ static int parse_primary(AVExpr **e, Parser *p) ...@@ -211,7 +211,7 @@ static int parse_primary(AVExpr **e, Parser *p)
p->s= strchr(p->s, '('); p->s= strchr(p->s, '(');
if (p->s==NULL) { if (p->s==NULL) {
av_log(p, AV_LOG_ERROR, "undefined constant or missing (\n"); av_log(p, AV_LOG_ERROR, "Undefined constant or missing '(' in '%s'\n", s0);
p->s= next; p->s= next;
av_free_expr(d); av_free_expr(d);
return AVERROR(EINVAL); return AVERROR(EINVAL);
...@@ -222,7 +222,7 @@ static int parse_primary(AVExpr **e, Parser *p) ...@@ -222,7 +222,7 @@ static int parse_primary(AVExpr **e, Parser *p)
if ((ret = parse_expr(&d, p)) < 0) if ((ret = parse_expr(&d, p)) < 0)
return ret; return ret;
if (p->s[0] != ')') { if (p->s[0] != ')') {
av_log(p, AV_LOG_ERROR, "missing )\n"); av_log(p, AV_LOG_ERROR, "Missing ')' in '%s'\n", s0);
av_free_expr(d); av_free_expr(d);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
...@@ -239,7 +239,7 @@ static int parse_primary(AVExpr **e, Parser *p) ...@@ -239,7 +239,7 @@ static int parse_primary(AVExpr **e, Parser *p)
parse_expr(&d->param[1], p); parse_expr(&d->param[1], p);
} }
if (p->s[0] != ')') { if (p->s[0] != ')') {
av_log(p, AV_LOG_ERROR, "missing )\n"); av_log(p, AV_LOG_ERROR, "Missing ')' or too many args in '%s'\n", s0);
av_free_expr(d); av_free_expr(d);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
...@@ -290,7 +290,7 @@ static int parse_primary(AVExpr **e, Parser *p) ...@@ -290,7 +290,7 @@ static int parse_primary(AVExpr **e, Parser *p)
} }
} }
av_log(p, AV_LOG_ERROR, "unknown function\n"); av_log(p, AV_LOG_ERROR, "Unknown function in '%s'\n", s0);
av_free_expr(d); av_free_expr(d);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
......
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