summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-10-23 10:53:18 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-01-11 23:17:36 +0100
commitb0259aa248e44dcc6960fa340d6377dd80026105 (patch)
tree4448abc0367ef20374f278f478580e73c2f6a9c2 /libavformat
parentfcc263caa9e11a1f94431a6d356a48003c636ef6 (diff)
avformat/utils: wrap_timestamp() is only needed for less than 64 bits
Fixes: shift exponent 64 is too large for 64-bit type 'unsigned long long' Fixes: 26497/clusterfuzz-testcase-minimized-ffmpeg_dem_AVI_fuzzer-5690188355076096 Fixes: 26903/clusterfuzz-testcase-minimized-ffmpeg_dem_LUODAT_fuzzer-5641466929741824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index c52f39e1b7..d193f9e85f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -101,7 +101,7 @@ static int is_relative(int64_t ts) {
*/
static int64_t wrap_timestamp(const AVStream *st, int64_t timestamp)
{
- if (st->internal->pts_wrap_behavior != AV_PTS_WRAP_IGNORE &&
+ if (st->internal->pts_wrap_behavior != AV_PTS_WRAP_IGNORE && st->pts_wrap_bits < 64 &&
st->internal->pts_wrap_reference != AV_NOPTS_VALUE && timestamp != AV_NOPTS_VALUE) {
if (st->internal->pts_wrap_behavior == AV_PTS_WRAP_ADD_OFFSET &&
timestamp < st->internal->pts_wrap_reference)