You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ID3v2: Growing a trailing WAV or AIFF chunk decreases the container size #724
Start with a RIFF/WAVE or FORM/AIFF stream whose final chunk is an ID3v2 tag, then save a larger ID3v2 tag to the same stream. After the write, compare the 32-bit container size at bytes 4 through 7 with the actual stream length minus eight.
This affects Lofty 0.25.2, 0.25.3, and the current main branch.
Summary
The trailing-chunk fast path subtracts tag growth from updated_stream_len:
When the replacement is larger, the outer RIFF/FORM size becomes smaller than the file. A sufficiently large increase also underflows and panics in debug builds after the new tag bytes have been written.
Growing a trailing ID3v2 chunk should increase the outer RIFF/FORM stream length. The declared container size should equal the actual stream length minus eight after the write.
Assets
No external asset is required. The bug reproduces with a minimal in-memory RIFF or FORM header and two successive ID3v2 writes.
Activity