diff options
| author | ville <ville@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-10-09 15:18:07 +0000 |
|---|---|---|
| committer | ville <ville@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-10-09 15:18:07 +0000 |
| commit | d2883181a38608b5fc8d86001da196eef8d69d8f (patch) | |
| tree | 6988b22856e780b0e36500d06f1f7ea85293ab27 | |
| parent | c0459fab66a0b85a240ba8273bde11c7ff2305b2 (diff) | |
| download | vdr-plugin-muggle-d2883181a38608b5fc8d86001da196eef8d69d8f.tar.gz vdr-plugin-muggle-d2883181a38608b5fc8d86001da196eef8d69d8f.tar.bz2 | |
Avoid crash with files that don't have a id3v2 tag.
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@881 e10066b5-e1e2-0310-b819-94efdf66514b
| -rw-r--r-- | mg_image_provider.c | 23 |
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 |
