]> git.sesse.net Git - ffmpeg/commitdiff
Revert "avutil/timecode: fix sscanf format string with garbage at the end"
authorMarton Balint <cus@passwd.hu>
Sat, 16 Jan 2021 08:42:01 +0000 (09:42 +0100)
committerMarton Balint <cus@passwd.hu>
Sat, 23 Jan 2021 18:54:14 +0000 (19:54 +0100)
This reverts commit 6696a07ac62bfec49dd488510a719367918b9f7a.

It is wrong to restrict timecodes to always contain leading zeros or for hours
or frames to be 2 chars only.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavutil/timecode.c

index 280e4cacfb34f188c0d78d9161a437c545adf39b..b1b504edbf601d8cd59effa71b2edf97791aa0e6 100644 (file)
@@ -252,7 +252,7 @@ int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *st
     char c;
     int hh, mm, ss, ff, flags;
 
-    if (sscanf(str, "%02u:%02u:%02u%c%02u", &hh, &mm, &ss, &c, &ff) != 5) {
+    if (sscanf(str, "%d:%d:%d%c%d", &hh, &mm, &ss, &c, &ff) != 5) {
         av_log(log_ctx, AV_LOG_ERROR, "Unable to parse timecode, "
                                       "syntax: hh:mm:ss[:;.]ff\n");
         return AVERROR_INVALIDDATA;