Skip to content

Commit 6696a07

Browse files
committed
avutil/timecode: fix sscanf format string with garbage at the end
Signed-off-by: Limin Wang <[email protected]>
1 parent c2424b1 commit 6696a07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libavutil/timecode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *st
252252
char c;
253253
int hh, mm, ss, ff, flags;
254254

255-
if (sscanf(str, "%d:%d:%d%c%d", &hh, &mm, &ss, &c, &ff) != 5) {
255+
if (sscanf(str, "%02u:%02u:%02u%c%02u", &hh, &mm, &ss, &c, &ff) != 5) {
256256
av_log(log_ctx, AV_LOG_ERROR, "Unable to parse timecode, "
257257
"syntax: hh:mm:ss[:;.]ff\n");
258258
return AVERROR_INVALIDDATA;

0 commit comments

Comments
 (0)