avfilter/af_channelmap: Check for missing argument in get_channel_idx()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 23 Jan 2015 14:03:40 +0000 (15:03 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 23 Jan 2015 14:03:40 +0000 (15:03 +0100)
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/af_channelmap.c

index c3454c5..2a43c12 100644 (file)
@@ -93,6 +93,8 @@ static int get_channel_idx(char **map, int *ch, char delim, int max_ch)
     int n = 0;
     if (!next && delim == '-')
         return AVERROR(EINVAL);
+    if (!*map)
+        return AVERROR(EINVAL);
     len = strlen(*map);
     sscanf(*map, "%d%n", ch, &n);
     if (n != len)