aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-03-19 20:06:06 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-03-19 20:09:22 +0100
commite19ccc89ef90dcc8ecc5e3e539761a6a6eccbcef (patch)
tree746be5c05211483f9912be18ec5b6813c510c0e6
parent11642cd16f1b18232bdeca4cddb2dd7c11cbd2f3 (diff)
downloadffmpeg-e19ccc89ef90dcc8ecc5e3e539761a6a6eccbcef.tar.gz
lavfi/aspect: fail with AVERROR(EINVAL) in case of invalid specified aspect
Previously it was returning 0 in case the aspect was parsable but invalid. X-ColaCount: +10*PHIl
-rw-r--r--libavfilter/vf_aspect.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index 89eaf5f189..9e3b93b28d 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -34,15 +34,14 @@ typedef struct {
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
{
AspectContext *aspect = ctx->priv;
- int ret;
aspect->ratio = (AVRational) {0, 1};
if (args) {
- if ((ret = av_parse_ratio(&aspect->ratio, args, 100, 0, ctx)) < 0 ||
+ if (av_parse_ratio(&aspect->ratio, args, 100, 0, ctx) ||
aspect->ratio.num < 0 || aspect->ratio.den <= 0) {
av_log(ctx, AV_LOG_ERROR,
"Invalid string '%s' for aspect ratio.\n", args);
- return ret;
+ return AVERROR(EINVAL);
}
}