avformat/mvdec: Use 64 bit in timestamp computation

Fixes: division by zero
Fixes: 42198/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-5054366405492736.fuzz
Fixes: 42222/clusterfuzz-testcase-minimized-ffmpeg_dem_MV_fuzzer-4561249331970048

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/379/head
Michael Niedermayer 3 years ago
parent 9092e58c44
commit 99b2700f5b
  1. 2
      libavformat/mvdec.c

@ -381,7 +381,7 @@ static int mv_read_header(AVFormatContext *avctx)
avio_skip(pb, 8);
av_add_index_entry(ast, pos, timestamp, asize, 0, AVINDEX_KEYFRAME);
av_add_index_entry(vst, pos + asize, i, vsize, 0, AVINDEX_KEYFRAME);
timestamp += asize / (ast->codecpar->channels * bytes_per_sample);
timestamp += asize / (ast->codecpar->channels * (uint64_t)bytes_per_sample);
}
} else if (!version && avio_rb16(pb) == 3) {
avio_skip(pb, 4);

Loading…
Cancel
Save