diff options
author | James Almer <jamrial@gmail.com> | 2019-04-17 01:23:36 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2019-04-28 19:48:45 -0300 |
commit | 67f9d3f461f65395f39d3e01801ce8b572d0aa12 (patch) | |
tree | 5c8f6abee5e7d3ea1200e99af249828f43b41f52 | |
parent | 3dee6c09970dd0defad91e8270f66a4be3b6570d (diff) | |
download | ffmpeg-67f9d3f461f65395f39d3e01801ce8b572d0aa12.tar.gz |
avcodec/cbs_av1: add missing value range constrains to timecode Metadata OBU
Also infer the value time_offset_length as 0 when it's not present.
Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/cbs_av1_syntax_template.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c index 59a98b18c9..b04cd51d55 100644 --- a/libavcodec/cbs_av1_syntax_template.c +++ b/libavcodec/cbs_av1_syntax_template.c @@ -1753,19 +1753,19 @@ static int FUNC(metadata_timecode)(CodedBitstreamContext *ctx, RWContext *rw, fb(9, n_frames); if (current->full_timestamp_flag) { - fb(6, seconds_value); - fb(6, minutes_value); - fb(5, hours_value); + fc(6, seconds_value, 0, 59); + fc(6, minutes_value, 0, 59); + fc(5, hours_value, 0, 23); } else { flag(seconds_flag); if (current->seconds_flag) { - fb(6, seconds_value); + fc(6, seconds_value, 0, 59); flag(minutes_flag); if (current->minutes_flag) { - fb(6, minutes_value); + fc(6, minutes_value, 0, 59); flag(hours_flag); if (current->hours_flag) - fb(5, hours_value); + fc(5, hours_value, 0, 23); } } } @@ -1773,6 +1773,8 @@ static int FUNC(metadata_timecode)(CodedBitstreamContext *ctx, RWContext *rw, fb(5, time_offset_length); if (current->time_offset_length > 0) fb(current->time_offset_length, time_offset_value); + else + infer(time_offset_length, 0); return 0; } |