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 f1126f2338 avformat/wavenc: Don't count padding in rf64 data chunk size
f1126f2338 is described below
commit f1126f23380c805b4b8fd69351d189aeac8b892b
Author: Daniel Verkamp <[email protected]>
AuthorDate: Tue Jun 9 00:01:59 2026 -0700
Commit: Daniel Verkamp <[email protected]>
CommitDate: Tue Jun 30 03:03:30 2026 +0000
avformat/wavenc: Don't count padding in rf64 data chunk size
When writing the trailer for a RF64 WAV file, the ds64 chunk's 64-bit
version of the data chunk size incorrectly included the padding byte
that may have been added by ff_end_tag() for the data chunk.
Fix this by calculating the data chunk size before calling ff_end_tag().
The data chunk padding byte is only needed when the data is not already
a multiple of two bytes in length, which is fairly rare, requiring
something like mono 8-bit or 24-bit PCM with an odd number of samples to
trigger (and only with -rf64 auto or -rf64 always, neither of which is
enabled by default), so this bug is not likely to have affected many
real-world files.
Signed-off-by: Daniel Verkamp <[email protected]>
---
libavformat/wavenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c
index 01fffaafe5..a8debf8faa 100644
--- a/libavformat/wavenc.c
+++ b/libavformat/wavenc.c
@@ -426,7 +426,8 @@ static int wav_write_trailer(AVFormatContext *s)
int ret = 0;
if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
- if (wav->write_peak != PEAK_ONLY && avio_tell(pb) - wav->data <
UINT32_MAX) {
+ data_size = avio_tell(pb) - wav->data;
+ if (wav->write_peak != PEAK_ONLY && data_size < UINT32_MAX) {
ff_end_tag(pb, wav->data);
}
@@ -436,7 +437,6 @@ static int wav_write_trailer(AVFormatContext *s)
/* update file size */
file_size = avio_tell(pb);
- data_size = file_size - wav->data;
if (wav->rf64 == RF64_ALWAYS || (wav->rf64 == RF64_AUTO && file_size -
8 > UINT32_MAX)) {
rf64 = 1;
} else if (file_size - 8 <= UINT32_MAX) {
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]