Skip to content

Commit

Permalink
avutil/timecode: fix sscanf format string with garbage at the end
Browse files Browse the repository at this point in the history
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
  • Loading branch information
lance-lmwang committed Jan 16, 2021
1 parent c2424b1 commit 6696a07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavutil/timecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, "%d:%d:%d%c%d", &hh, &mm, &ss, &c, &ff) != 5) {
if (sscanf(str, "%02u:%02u:%02u%c%02u", &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;
Expand Down

0 comments on commit 6696a07

Please sign in to comment.