]> granicus.if.org Git - taglib/commitdiff
Don't lead the scanned blocks on save
authorScott Wheeler <wheeler@kde.org>
Mon, 9 May 2011 17:06:08 +0000 (19:06 +0200)
committerLukáš Lalinský <lalinsky@gmail.com>
Sat, 10 Mar 2012 07:52:17 +0000 (08:52 +0100)
taglib/flac/flacfile.cpp

index f882ae7bda6e119c8f57340bdfe5f051fcbb7d04..4e3d2b36cdfa0cec6b0ae47bd559143a8af0cc4c 100644 (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;
   }