From 0ea87ebc19c843747d6e3f7e060e2f2da634eb03 Mon Sep 17 00:00:00 2001 From: James Almer Date: Mon, 31 Jan 2022 22:56:48 -0300 Subject: [PATCH] avformat/demux: don't truncate the return value of ts_to_samples() Signed-off-by: James Almer --- libavformat/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/demux.c b/libavformat/demux.c index 4509015847..ec34b65288 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -1346,7 +1346,7 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) if (sti->first_discard_sample && pkt->pts != AV_NOPTS_VALUE) { int64_t pts = pkt->pts - (is_relative(pkt->pts) ? RELATIVE_TS_BASE : 0); int64_t sample = ts_to_samples(st, pts); - int duration = ts_to_samples(st, pkt->duration); + int64_t duration = ts_to_samples(st, pkt->duration); int64_t end_sample = sample + duration; if (duration > 0 && end_sample >= sti->first_discard_sample && sample < sti->last_discard_sample)