Commit 9f6431c8 authored by Michael Niedermayer's avatar Michael Niedermayer

avfilter/af_channelmap: Move potential dereference after NULL check in get_channel_idx()

Fixes CID1270822
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bdb31942
...@@ -88,13 +88,14 @@ static char* split(char *message, char delim) { ...@@ -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) static int get_channel_idx(char **map, int *ch, char delim, int max_ch)
{ {
char *next = split(*map, delim); char *next;
int len; int len;
int n = 0; int n = 0;
if (!next && delim == '-')
return AVERROR(EINVAL);
if (!*map) if (!*map)
return AVERROR(EINVAL); return AVERROR(EINVAL);
next = split(*map, delim);
if (!next && delim == '-')
return AVERROR(EINVAL);
len = strlen(*map); len = strlen(*map);
sscanf(*map, "%d%n", ch, &n); sscanf(*map, "%d%n", ch, &n);
if (n != len) if (n != len)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment