Fixes: signed integer overflow: 24320 + 9223372036854775573 cannot be represented in type 'long' Fixes: 71001/clusterfuzz-testcase-minimized-ffmpeg_dem_MATROSKA_fuzzer-5644785744936960
Unified · Split
| @@ -2810,7 +2810,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) · 2809 unmodified lines | ||
| 2810 | 2810 | av_packet_unref(pkt1); |
| 2811 | 2811 | break; |
| 2812 | 2812 | } |
| 2813 | − if (pkt->duration > 0) { | |
| 2813 | + if (pkt->duration > 0 && pkt->duration < INT64_MAX - sti->info->codec_info_duration) { | |
| 2814 | 2814 | const int fields = sti->codec_desc && (sti->codec_desc->props & AV_CODEC_PROP_FIELDS); |
| 2815 | 2815 | if (avctx->codec_type == AVMEDIA_TYPE_SUBTITLE && pkt->pts != AV_NOPTS_VALUE && st->start_time != AV_NOPTS_VALUE && pkt->pts >= st->start_time |
| 2816 | 2816 | && (uint64_t)pkt->pts - st->start_time < INT64_MAX |