From 579795b2049bc8b0f291b302e7ab24f9561eaf24 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 23 Jan 2015 15:03:40 +0100 Subject: [PATCH] avfilter/af_channelmap: Check for missing argument in get_channel_idx() Fixes null pointer dereference Signed-off-by: Michael Niedermayer --- libavfilter/af_channelmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index c3454c5b69..2a43c12af2 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -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)