]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/parseutils.c
avformat/rtsp: Remove deprecated old options, rename stimeout->timeout
[ffmpeg] / libavutil / parseutils.c
index 167e8226482f72481e7ac8fbcebd9f8b4fb20a70..7f678cd85af190535c2912910aeb06650a64161e 100644 (file)
@@ -736,12 +736,14 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
     if (*q)
         return AVERROR(EINVAL);
 
-    if (INT64_MAX / suffix < t)
+    if (INT64_MAX / suffix < t || t < INT64_MIN / suffix)
         return AVERROR(ERANGE);
     t *= suffix;
     if (INT64_MAX - microseconds < t)
         return AVERROR(ERANGE);
     t += microseconds;
+    if (t == INT64_MIN && negative)
+        return AVERROR(ERANGE);
     *timeval = negative ? -t : t;
     return 0;
 }