Browse Source

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>
tags/n4.4
Michael Niedermayer 5 years ago
parent
commit
b0259aa248
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavformat/utils.c

+ 1
- 1
libavformat/utils.c View File

@@ -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)


Loading…
Cancel
Save