diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c
index 97740f103deeb1037a9b5c05bfa71a0592ab49c3..2f1b8ce6b177d234daefe47d4b718e11d6730278 100644
--- a/libavfilter/vf_aspect.c
+++ b/libavfilter/vf_aspect.c
@@ -47,11 +47,11 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
             return AVERROR(EINVAL);
         }
 
-            gcd = av_gcd(FFABS(aspect->aspect.num), FFABS(aspect->aspect.den));
-            if (gcd) {
-                aspect->aspect.num /= gcd;
-                aspect->aspect.den /= gcd;
-            }
+        gcd = av_gcd(FFABS(aspect->aspect.num), FFABS(aspect->aspect.den));
+        if (gcd) {
+            aspect->aspect.num /= gcd;
+            aspect->aspect.den /= gcd;
+        }
     }
 
     if (aspect->aspect.den == 0)