]> git.sesse.net Git - ffmpeg/commitdiff
parseutils: accept only full "ms" suffix
authorRostislav Pehlivanov <atomnuker@gmail.com>
Sat, 3 Mar 2018 20:17:46 +0000 (20:17 +0000)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Mon, 5 Mar 2018 20:38:35 +0000 (20:38 +0000)
The commit which added those was pushed prematurely before anyone could object
to illogical suffixes like just m for milliseconds. Without this, we'd be locked
into never being able to implement the "m" suffix for minutes.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavutil/parseutils.c

index 44c845577a9a00c16b6b71b15fd66d9d739b7f8f..95274f564f2ca55dadbc79cad3df436ba89aa5f2 100644 (file)
@@ -689,10 +689,10 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
 
     if (duration) {
         t = dt.tm_hour * 3600 + dt.tm_min * 60 + dt.tm_sec;
-        if (*q == 'm') {
+        if (q[0] == 'm' && q[1] == 's') {
             suffix = 1000;
             microseconds /= 1000;
-            q++;
+            q += 2;
         } else if (*q == 'u') {
             suffix = 1;
             microseconds = 0;