avformat/utils: Do not assume duration is non negative in compute_pkt_fields()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 5 Sep 2019 21:06:21 +0000 (23:06 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Tue, 24 Sep 2019 15:53:39 +0000 (17:53 +0200)
commit72db18e929cf3310cfc2a6eb4170a0d390e5a105
treee90beadfab56edb07ea597468e7fa6afe07d8abc
parentc7ccbf40edb81d40727cca3a7ffd1848d3ed880a
avformat/utils: Do not assume duration is non negative in compute_pkt_fields()

Several subtitle demuxers set negative durations

Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long'
Fixes: 16925/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5766519790764032

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/utils.c