mirror of
https://github.com/taglib/taglib.git
synced 2026-01-26 10:03:03 -05:00
Avoid corrupting an (invalid) FLAC Ogg file without Vorbis comment
FLAC in Ogg must have a Vorbis comment Metadata block, but in case the file still has none avoid overwriting the first packet, i.e. the Streaminfo Metadata block.
This commit is contained in:
committed by
Urs Fleisch
parent
70c6a0c75f
commit
b4a4b42254
@ -107,6 +107,11 @@ Properties *Ogg::FLAC::File::audioProperties() const
|
||||
|
||||
bool Ogg::FLAC::File::save()
|
||||
{
|
||||
if (d->commentPacket == 0) {
|
||||
debug("Ogg::FLAC::File::save() -- Invalid, file has no Vorbis comment metadata block.");
|
||||
return false;
|
||||
}
|
||||
|
||||
d->xiphCommentData = d->comment->render(false);
|
||||
|
||||
// Create FLAC metadata-block:
|
||||
|
||||
Reference in New Issue
Block a user