Browse Source

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

Fixes CID1270822

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.6
Michael Niedermayer 11 years ago
parent
commit
9f6431c8f6
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      libavfilter/af_channelmap.c

+ 4
- 3
libavfilter/af_channelmap.c View File

@@ -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)


Loading…
Cancel
Save