[FFmpeg-cvslog] avfilter/af_channelmap: Move potential dereference after NULL check in get_channel_idx()
Michael Niedermayer
git at videolan.org
Wed Feb 18 13:48:10 CET 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Feb 18 13:40:39 2015 +0100| [9f6431c8f6c4e92e3f6ea2f3bc8f58677a7e7ce3] | committer: Michael Niedermayer
avfilter/af_channelmap: Move potential dereference after NULL check in get_channel_idx()
Fixes CID1270822
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9f6431c8f6c4e92e3f6ea2f3bc8f58677a7e7ce3
---
libavfilter/af_channelmap.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
index 2a43c12..cc66f04 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)
More information about the ffmpeg-cvslog
mailing list