taglib/taglib — pull request #99 by davidsansome (2013-02-17 07:51:22+00:00)
Title: Stop loading a FLAC file if it has too many metadata blocks.

A file containing all \0 bytes is a valid stream of empty STREAMINFO
METADATA_BLOCKs. FLAC::File::scan reads all these into memory, if the file
is large Taglib may consume all the memory on the machine.

This patch adds a safety that stops reading after 1024 blocks. (1024 should
be enough for anyone).

For a (large) example file that triggers the problem, see:
https://docs.google.com/file/d/0Byds9jlkR0IxQnpYUUxTZnVtQU0/edit
Uploaded by this user:
http://code.google.com/p/clementine-player/issues/detail?id=3500