Don't lead the scanned blocks on save

This commit is contained in:
Scott Wheeler 2011-05-09 19:06:08 +02:00
parent 6b7ed4a5d5
commit efeccbf726

View File

@ -161,10 +161,12 @@ bool FLAC::File::save()
MetadataBlock *block = d->blocks[i];
if(block->code() == MetadataBlock::VorbisComment) {
// Set the new Vorbis Comment block
delete block;
block = new UnknownMetadataBlock(MetadataBlock::VorbisComment, d->xiphCommentData);
foundVorbisCommentBlock = true;
}
if(block->code() == MetadataBlock::Padding) {
delete block;
continue;
}
newBlocks.append(block);
@ -190,7 +192,7 @@ bool FLAC::File::save()
// Adjust the padding block(s)
long originalLength = d->streamStart - d->flacStart;
int paddingLength = originalLength - data.size() - 4;
int paddingLength = originalLength - data.size() - 4;
if (paddingLength < 0) {
paddingLength = MinPaddingLength;
}