]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_format.c
Merge commit 'abda15a990527557c20848f6ca2f82eb85e76dc9'
[ffmpeg] / libavfilter / vf_format.c
index afa17fe8a284180c8eef4671fae8fcc4dc92d85f..13b41e46639aa128ed0fc7ca1b020a483091a36e 100644 (file)
@@ -60,6 +60,9 @@ static av_cold int init(AVFilterContext *ctx)
     int i;
     int ret;
 
+    if (!s->pix_fmts)
+        return AVERROR(EINVAL);
+
     /* count the formats */
     cur = s->pix_fmts;
     while ((cur = strchr(cur, '|'))) {
@@ -72,9 +75,6 @@ static av_cold int init(AVFilterContext *ctx)
     if (!s->formats)
         return AVERROR(ENOMEM);
 
-    if (!s->pix_fmts)
-        return AVERROR(EINVAL);
-
     /* parse the list of formats */
     cur = s->pix_fmts;
     for (i = 0; i < nb_formats; i++) {