summaryrefslogtreecommitdiff
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-07-03 23:02:16 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-14 16:51:29 +0200
commit4d81550df9580b454d2530bcb37de20b8354ad6e (patch)
tree612e1ce73434106beccfd9291ba43c8555f0de96 /libavformat/utils.c
parentbbc24363f137377376cea59a48affe7c556b8c30 (diff)
avformat/utils: Ignore negative duration in codec_info_duration computation
Fixes: signed integer overflow: -5994697211974418462 + -3255307777713450286 cannot be represented in type 'long' Fixes: 35332/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5868035117285376 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/utils.c')
-rw-r--r--libavformat/utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index b56190d2da..a322137fcf 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3813,7 +3813,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
av_packet_unref(pkt1);
break;
}
- if (pkt->duration) {
+ if (pkt->duration > 0) {
if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && st->start_time != AV_NOPTS_VALUE && pkt->pts >= st->start_time
&& (uint64_t)pkt->pts - st->start_time < INT64_MAX
) {