On 04/13/2013 08:21 AM, Reinhard Tartler wrote:
> reported by clang-scan analysis
> ---
> libavfilter/af_channelmap.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c
> index da83009..9f4f4d0 100644
> --- a/libavfilter/af_channelmap.c
> +++ b/libavfilter/af_channelmap.c
> @@ -92,9 +92,13 @@ 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 (!*map)
> + return AVERROR(EINVAL);
> + next = split(*map, delim);
> if (!next && delim == '-')
> return AVERROR(EINVAL);
> len = strlen(*map);
I'm not against being safe, but why and when *map is NULL?
lu
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel