Skip to content
Snippets Groups Projects
Commit 9abf3441 authored by Stefano Sabatini's avatar Stefano Sabatini
Browse files

Log error message in case of invalid parsing.

Originally committed as revision 25765 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent bdb47f3a
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,11 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) ...@@ -37,8 +37,11 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
if (args) { if (args) {
if (sscanf(args, "%d:%d", &aspect->aspect.num, &aspect->aspect.den) < 2) { if (sscanf(args, "%d:%d", &aspect->aspect.num, &aspect->aspect.den) < 2) {
if (sscanf(args, "%lf", &ratio) < 1) if (sscanf(args, "%lf", &ratio) < 1) {
return -1; av_log(ctx, AV_LOG_ERROR,
"Invalid string '%s' for aspect ratio.\n", args);
return AVERROR(EINVAL);
}
aspect->aspect = av_d2q(ratio, 100); aspect->aspect = av_d2q(ratio, 100);
} else { } else {
gcd = av_gcd(FFABS(aspect->aspect.num), FFABS(aspect->aspect.den)); gcd = av_gcd(FFABS(aspect->aspect.num), FFABS(aspect->aspect.den));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment