commit 0b55f03fa092241dd4533ef0fd4a18b2d97a1b25
Author: David Sansome <me@davidsansome.com>
Date:   Sun Feb 17 18:39:49 2013 +1100

    Stop loading a FLAC file if it has too many metadata blocks.

diff --git a/3rdparty/taglib/flac/flacfile.cpp b/3rdparty/taglib/flac/flacfile.cpp
index a02770a..d308256 100644
--- a/3rdparty/taglib/flac/flacfile.cpp
+++ b/3rdparty/taglib/flac/flacfile.cpp
@@ -416,9 +416,18 @@ void FLAC::File::scan()
   d->blocks.append(new UnknownMetadataBlock(blockType, d->streamInfoData));
   nextBlockOffset += length + 4;
 
+  int blockCount = 0;
+
   // Search through the remaining metadata
   while(!isLastBlock) {
 
+    if (++blockCount > 1024) {
+      debug("FLAC::File::scan() -- FLAC stream has more than 1024 metadata "
+            "blocks, probably corrupt.");
+      setValid(false);
+      return;
+    }
+
     header = readBlock(4);
     blockType = header[0] & 0x7f;
     isLastBlock = (header[0] & 0x80) != 0;
