mirror of
https://github.com/taglib/taglib.git
synced 2026-08-27 12:47:01 -04:00
c275891a77cc424bf70d13324135d7cdf27c4e52
Same shape as the DSF change: sampleCount comes from a chunk size in the
file and sampleRate is read from it, so
static_cast<int>(static_cast<double>(d->sampleCount) * 1000.0
/ d->sampleRate + 0.5)
can be handed a value int cannot represent, which is undefined.
In the PR I said I had not demonstrated this one, because chunkFits
bounds the sample count by the file length so a few mutated bytes will
not do it. Constructing the file it does need - a 700 kB DSD chunk with
a sample rate of 1 - reaches it:
taglib/dsdiff/dsdiffproperties.cpp:61:24: runtime error: 2.8e+09 is
outside the range of representable values of type 'int'
Two reports before the change, none after. tests/data/empty10ms.dff is
unchanged at lengthMs=10 bitrate=5644 rate=2822400 ch=2.
Assisted-By: Claude Code (Claude Opus 5)
TagLib
TagLib Audio Metadata Library
TagLib is a library for reading and editing the metadata of several popular audio formats. Currently, it supports various metadata containers such as ID3v1, ID3v2 and Vorbis comments for MP3, MP4, AAC, Ogg, Opus, FLAC, Speex, APE, MPC, WavPack, WAV, AIFF, TrueAudio, Matroska, WebM, ASF, WMA, DSF, DFF and tracker (MOD, XM, S3M, IT) files.
TagLib is distributed under the GNU Lesser General Public License (LGPL) and Mozilla Public License (MPL). Essentially that means that it may be used in proprietary applications, but if changes are made to TagLib they must be contributed back to the project. Please review the licenses if you are considering using TagLib in your project.
Languages
C++
96.7%
CMake
2%
C
0.9%
Logos
0.4%