From 63ce7c71bc1b1b6c141df5daae0f8fed52194b72 Mon Sep 17 00:00:00 2001 From: Dale Curtis Date: Thu, 14 May 2020 14:47:49 -0700 Subject: [PATCH] avformat: Fix overflow in compute_pkt_fields(). Signed-off-by: Dale Curtis Signed-off-by: Michael Niedermayer --- libavformat/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/utils.c b/libavformat/utils.c index b3d902c6b5..667249362c 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1359,7 +1359,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if (st->last_IP_duration == 0 && (uint64_t)pkt->duration <= INT32_MAX) st->last_IP_duration = pkt->duration; if (pkt->dts != AV_NOPTS_VALUE) - st->cur_dts = pkt->dts + st->last_IP_duration; + st->cur_dts = av_sat_add64(pkt->dts, st->last_IP_duration); if (pkt->dts != AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE && st->last_IP_duration > 0 &&