summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mg_image_provider.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/mg_image_provider.c b/mg_image_provider.c
index a9418f3..c2500e7 100644
--- a/mg_image_provider.c
+++ b/mg_image_provider.c
@@ -310,22 +310,33 @@ string mgImageProvider::extractImagesFromTag( string f )
if( !strcasecmp(extension(filename), "flac") )
{
TagLib::FLAC::File f(filename);
- l = f.ID3v2Tag()->frameListMap()["APIC"];
- dir = treatFrameList( l, image_cache );
+ if (f.ID3v2Tag())
+ {
+ l = f.ID3v2Tag()->frameListMap()["APIC"];
+ dir = treatFrameList( l, image_cache );
+ }
}
else if( !strcasecmp(extension(filename), "mp3") )
{
TagLib::MPEG::File f(filename);
- l = f.ID3v2Tag()->frameListMap()["APIC"];
- dir = treatFrameList( l, image_cache );
+ if (f.ID3v2Tag())
+ {
+ l = f.ID3v2Tag()->frameListMap()["APIC"];
+ dir = treatFrameList( l, image_cache );
+ }
}
else if( !strcasecmp(extension(filename), "ogg") )
{
// what to do here?
TagLib::Vorbis::File f(filename);
- // l = f.ID3v2Tag()->frameListMap()["APIC"];
- // dir = treatFrameList( l, image_cache );
+ /*
+ if (f.ID3v2Tag())
+ {
+ l = f.ID3v2Tag()->frameListMap()["APIC"];
+ dir = treatFrameList( l, image_cache );
+ }
+ */
}
// returns empty if no images were found in tags