]> git.sesse.net Git - ffmpeg/commitdiff
avfilter/vf_v360: handle gracefully invalid values for rorder option
authorPaul B Mahol <onemda@gmail.com>
Tue, 25 Feb 2020 10:12:02 +0000 (11:12 +0100)
committerPaul B Mahol <onemda@gmail.com>
Tue, 25 Feb 2020 10:12:02 +0000 (11:12 +0100)
libavfilter/vf_v360.c

index 6477303ca57c67b847495ec6cc34614ea8e349b4..6b0d8b21aef55842199cd79906124e8d1ebc3cb6 100644 (file)
@@ -3271,16 +3271,22 @@ static int config_output(AVFilterLink *outlink)
         int rorder;
 
         if (c == '\0') {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Incomplete rorder option. Direction for all 3 rotation orders should be specified.\n");
-            return AVERROR(EINVAL);
+            av_log(ctx, AV_LOG_WARNING,
+                   "Incomplete rorder option. Direction for all 3 rotation orders should be specified. Switching to default rorder.\n");
+            s->rotation_order[0] = YAW;
+            s->rotation_order[1] = PITCH;
+            s->rotation_order[2] = ROLL;
+            break;
         }
 
         rorder = get_rorder(c);
         if (rorder == -1) {
-            av_log(ctx, AV_LOG_ERROR,
-                   "Incorrect rotation order symbol '%c' in rorder option.\n", c);
-            return AVERROR(EINVAL);
+            av_log(ctx, AV_LOG_WARNING,
+                   "Incorrect rotation order symbol '%c' in rorder option. Switching to default rorder.\n", c);
+            s->rotation_order[0] = YAW;
+            s->rotation_order[1] = PITCH;
+            s->rotation_order[2] = ROLL;
+            break;
         }
 
         s->rotation_order[order] = rorder;