This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 7bced195da avformat/wavdec: cache avio_size() before footer seeks
7bced195da is described below

commit 7bced195dabc09959de95eaa0cd22b2b3df8a7b4
Author:     Andreas Menze <[email protected]>
AuthorDate: Thu Aug 13 09:11:27 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Sun Aug 30 14:27:03 2026 +0000

    avformat/wavdec: cache avio_size() before footer seeks
    
    Over HTTP, seeking to a trailing chunk can make avio_size() stale, so the 
PCM
    duration guard fails and duration is N/A. Cache size before seeking.
    
    Fixes #24122
---
 libavformat/wavdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/wavdec.c b/libavformat/wavdec.c
index 8501d94deb..8d19e52ead 100644
--- a/libavformat/wavdec.c
+++ b/libavformat/wavdec.c
@@ -370,11 +370,13 @@ static int wav_read_header(AVFormatContext *s)
     WAVDemuxContext *wav = s->priv_data;
     int ret, got_fmt = 0, got_xma2 = 0;
     int64_t next_tag_ofs, data_ofs = -1;
+    int64_t filesize;
 
     wav->unaligned = avio_tell(s->pb) & 1;
 
     wav->smv_data_ofs = -1;
 
+    filesize = avio_size(pb);
     /* read chunk ID */
     tag = avio_rl32(pb);
     switch (tag) {
@@ -661,7 +663,7 @@ break_loop:
         if (   st->codecpar->ch_layout.nb_channels
             && data_size
             && av_get_bits_per_sample(st->codecpar->codec_id)
-            && wav->data_end <= avio_size(pb))
+            && wav->data_end <= filesize)
             sample_count = (data_size << 3)
                                   /
                 (st->codecpar->ch_layout.nb_channels * 
(uint64_t)av_get_bits_per_sample(st->codecpar->codec_id));

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to