]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/formats.c
Merge commit '62549f9655c48f0ec061087fa33a96040ce01145'
[ffmpeg] / libavfilter / formats.c
index 43718e465572dcfc5d335d8bd5f338274b07c1f1..ea2462793eb7f8a7e1c44345920a0c1eb9c67525 100644 (file)
@@ -184,6 +184,10 @@ AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
             for (i = j = 0; i < b->nb_channel_layouts; i++)
                 if (KNOWN(b->channel_layouts[i]))
                     b->channel_layouts[j++] = b->channel_layouts[i];
+            /* Not optimal: the unknown layouts of b may become known after
+               another merge. */
+            if (!j)
+                return NULL;
             b->nb_channel_layouts = j;
         }
         MERGE_REF(b, a, channel_layouts, AVFilterChannelLayouts, fail);