mirror of
https://github.com/taglib/taglib.git
synced 2025-11-16 22:52:57 -05:00
With specially crafted WAV files having the "id3 " chunk as the only valid chunk, when trying to write the tags, the existing "id3 " chunk is removed, and then vector::front() is called on the now empty chunks vector. Now it is checked if the vector is empty to avoid the crash.
This commit is contained in:
@ -361,6 +361,9 @@ void RIFF::File::writeChunk(const ByteVector &name, const ByteVector &data,
|
||||
|
||||
void RIFF::File::updateGlobalSize()
|
||||
{
|
||||
if(d->chunks.empty())
|
||||
return;
|
||||
|
||||
const Chunk first = d->chunks.front();
|
||||
const Chunk last = d->chunks.back();
|
||||
d->size = static_cast<unsigned int>(last.offset + last.size + last.padding - first.offset + 12);
|
||||
|
||||
Reference in New Issue
Block a user