13
0

Potential fix for taglib v2.0 crashes when exporting wav

Note that taglib's documentation states that ID3v2Tag()
always returns a valid pointer regardless of whether or not
the file on disk has an ID3v2 tag.
This commit is contained in:
Robin Gareus 2024-02-17 00:50:29 +01:00
parent f5789852de
commit 35686baa2b
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -88,11 +88,9 @@ AudiofileTagger::tag_file (std::string const& filename, SessionMetadata const& m
TagLib::RIFF::Info::Tag* info_tag = dynamic_cast<TagLib::RIFF::Info::Tag*> (wav_file->InfoTag ());
assert (info_tag);
tag_riff_info (*info_tag, metadata);
#if 1 // Also add id3v2 header to .wav
TagLib::ID3v2::Tag* id3v2_tag = dynamic_cast<TagLib::ID3v2::Tag*> (wav_file->tag ());
TagLib::ID3v2::Tag* id3v2_tag = wav_file->ID3v2Tag ();
assert (id3v2_tag);
tag_id3v2 (*id3v2_tag, metadata);
#endif
}
TagLib::RIFF::AIFF::File* aiff_file;