diff mbox series

[FFmpeg-devel,4/4] avformat/demux: don't truncate the return value of ts_to_samples()

Message ID 20220201015648.2086-4-jamrial@gmail.com
State Accepted
Commit 0ea87ebc19c843747d6e3f7e060e2f2da634eb03
Headers show
Series [FFmpeg-devel,1/4] avformat/demux: don't propagate unsupported skip samples packet side data values | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

James Almer Feb. 1, 2022, 1:56 a.m. UTC
Signed-off-by: James Almer <jamrial@gmail.com>
---
 libavformat/demux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

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)