]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_aspect.c
lavfi/aspect: fail with AVERROR(EINVAL) in case of invalid specified aspect
[ffmpeg] / libavfilter / vf_aspect.c
index 89eaf5f18914058cca852c2d1819c3c42a228cf3..9e3b93b28daae1c9c63eb201819e88bb368a262d 100644 (file)
@@ -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);
         }
     }