[FFmpeg-devel] [PATCH] avutil/parseutils: only accept full us duration, do not accept mss duration

Marton Balint cus at passwd.hu
Wed Mar 7 23:50:21 EET 2018



On Tue, 6 Mar 2018, Marton Balint wrote:

> Accepting 'u' suffix for a time specification is neither intuitive nor
> consistent (now that we don't accept m). Also there was a bug in the code
> accepting an extra 's' even after 'ms'.
>
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
> libavutil/parseutils.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)

Will apply this soon.

Regards,
Marton

>
> diff --git a/libavutil/parseutils.c b/libavutil/parseutils.c
> index 95274f564f..924c49d52c 100644
> --- a/libavutil/parseutils.c
> +++ b/libavutil/parseutils.c
> @@ -693,12 +693,11 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
>             suffix = 1000;
>             microseconds /= 1000;
>             q += 2;
> -        } else if (*q == 'u') {
> +        } else if (q[0] == 'u' && q[1] == 's') {
>             suffix = 1;
>             microseconds = 0;
> -            q++;
> -        }
> -        if (*q == 's')
> +            q += 2;
> +        } else if (*q == 's')
>             q++;
>     } else {
>         int is_utc = *q == 'Z' || *q == 'z';
> -- 
> 2.13.6
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list