aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-02 22:48:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-02 22:48:03 +0200
commitde488525e5932235813e6d5f30a7554bf927a87a (patch)
tree6ea034df2d033d77577991041d0322c54aea9413
parent636c2dd4389d7aad71c6ee7434d6bf7e9de1a108 (diff)
downloadffmpeg-de488525e5932235813e6d5f30a7554bf927a87a.tar.gz
tools/ffeval: Check return value of av_expr_parse_and_eval()
Fixes CID1026745 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--tools/ffeval.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/ffeval.c b/tools/ffeval.c
index 4f60688b12..66b103294f 100644
--- a/tools/ffeval.c
+++ b/tools/ffeval.c
@@ -118,12 +118,13 @@ int main(int argc, char **argv)
buf[count] = 0;
if (buf[0] != '#') {
- av_expr_parse_and_eval(&d, buf,
- NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, 0, NULL);
+ int ret = av_expr_parse_and_eval(&d, buf,
+ NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, 0, NULL);
if (echo)
fprintf(outfile, "%s ", buf);
- fprintf(outfile, "%s%f\n", prompt, d);
+ if (ret >= 0) fprintf(outfile, "%s%f\n", prompt, d);
+ else fprintf(outfile, "%s%s\n", prompt, av_err2str(ret));
}
count = 0;
} else {