[FFmpeg-cvslog] tools/ffeval: Check return value of av_expr_parse_and_eval()
Michael Niedermayer
git at videolan.org
Sun Jun 2 22:59:48 CEST 2013
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun 2 22:48:03 2013 +0200| [de488525e5932235813e6d5f30a7554bf927a87a] | committer: Michael Niedermayer
tools/ffeval: Check return value of av_expr_parse_and_eval()
Fixes CID1026745
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=de488525e5932235813e6d5f30a7554bf927a87a
---
tools/ffeval.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tools/ffeval.c b/tools/ffeval.c
index 4f60688..66b1032 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 {
More information about the ffmpeg-cvslog
mailing list