diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2013-03-14 21:54:48 +0100 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2013-04-01 10:37:48 +0200 |
commit | f810ca63f804cd9f9da5e7a788ecc5b638b706c0 (patch) | |
tree | 0501bff454278a1389d3ef2f8c3971993a3de1f6 | |
parent | 7d057515818d606fd1d7ab9f0dc1eebf31a47239 (diff) | |
download | ffmpeg-f810ca63f804cd9f9da5e7a788ecc5b638b706c0.tar.gz |
lavfi: detect merge failure for unknown layouts.
Detect when filtering known layouts from an explicit list
results in an empty list.
Fix erratic behavior.
-rw-r--r-- | libavfilter/formats.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 43718e4655..ea2462793e 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -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); |