mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
avformat/subtitles: Check pts difference before use
Fixes: signed integer overflow: 0 - -9223372036854775808 cannot be represented in type 'long' Fixes: 29102/clusterfuzz-testcase-minimized-ffmpeg_dem_MPL2_fuzzer-6747053545881600 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
8ef25d1182
commit
e7a990164f
@ -206,7 +206,7 @@ void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q)
|
||||
q->sort == SUB_SORT_TS_POS ? cmp_pkt_sub_ts_pos
|
||||
: cmp_pkt_sub_pos_ts);
|
||||
for (i = 0; i < q->nb_subs; i++)
|
||||
if (q->subs[i]->duration < 0 && i < q->nb_subs - 1)
|
||||
if (q->subs[i]->duration < 0 && i < q->nb_subs - 1 && q->subs[i + 1]->pts - (uint64_t)q->subs[i]->pts <= INT64_MAX)
|
||||
q->subs[i]->duration = q->subs[i + 1]->pts - q->subs[i]->pts;
|
||||
|
||||
if (!q->keep_duplicates)
|
||||
|
Loading…
Reference in New Issue
Block a user