Commit 494a131144 for ffmpeg
commit 494a13114410c2863e6c4150f43b802b5d310b90
Author: Romain Beauxis <romain.beauxis@gmail.com>
Date: Fri Nov 27 08:22:21 2026 -0600
avformat/ogg/demuxer/vorbis: do not truncate the granule of an unparsable page
The timestamp of a page holding a packet that cannot be parsed falls back
to zero, by taking the page granule as the page duration. That duration
was an int: past 2^31 samples the granule was truncated and the timestamp
was a multiple of 2^32 instead.
diff --git a/libavformat/ogg/demuxer/vorbis.c b/libavformat/ogg/demuxer/vorbis.c
index 2b4ccea305..eec067dcc1 100644
--- a/libavformat/ogg/demuxer/vorbis.c
+++ b/libavformat/ogg/demuxer/vorbis.c
@@ -354,7 +354,8 @@ static int vorbis_check_packet_order(AVFormatContext *s,
static int64_t vorbis_page_start_pts(struct ogg_stream *os,
struct oggvorbis_private *priv)
{
- int page_duration = os->pduration, flags = 0;
+ int64_t page_duration = os->pduration;
+ int flags = 0;
uint8_t *last_pkt = os->buf + os->pstart + os->psize;
uint8_t *next_pkt = last_pkt;