Some types of bad FLAC files error out early in the metadata parsing phase,
and we weren't properly deleting the iterator if it errored out at that
point.
On my music archive, minidlnad wasn't anywhere near through scanning,
and had already leaked in excess of 10GiB from this.
The basic problem is that song_metadata has one image pointer. When it
sees a picture metadata item, it mallocs some space and copies the
picture to that, then sets the image pointer. That's all well and good,
except FLAC (and some other formats, haven't checked them) allow more
than one picture. So on the second picture, it does the same
thing—except overwriting the previous pointer, thus leaking it.
Simple fix: check if != NULL, ignore picture.
Signed-off-by: Justin Maggard <jmaggard@netgear.com>
1) Taglib does not support MP4 or WMA/ASF without hacking it in there.
2) Taglib is C++, so it's nice to remove that dependency.
* Use embedded album art where available.