diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 2a43c12af2..cc66f0436f 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -88,13 +88,14 @@ static char* split(char *message, char delim) { static int get_channel_idx(char **map, int *ch, char delim, int max_ch) { - char *next = split(*map, delim); + char *next; int len; int n = 0; - if (!next && delim == '-') - return AVERROR(EINVAL); if (!*map) return AVERROR(EINVAL); + next = split(*map, delim); + if (!next && delim == '-') + return AVERROR(EINVAL); len = strlen(*map); sscanf(*map, "%d%n", ch, &n); if (n != len)