From: Scott Wheeler Date: Fri, 9 May 2008 00:16:30 +0000 (+0000) Subject: Do a dynamic_cast on these instead of a static since in the case of a non-supported X-Git-Tag: v1.6rc1~90 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d4527a0141d01d905896c6ae206432569b6bf84b;p=taglib Do a dynamic_cast on these instead of a static since in the case of a non-supported frame flag the frame will still be added to the list, but using the UnknownFrame type rather than the canonical type. At the moment, on systems with a build in zlib, this should only happen for the (very rare) encrypted frames. BUG:161721 CCMAIL:taglib-devel@kde.org git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@805637 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index beb496c8..19f663c5 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -125,7 +125,9 @@ String ID3v2::Tag::comment() const for(FrameList::ConstIterator it = comments.begin(); it != comments.end(); ++it) { - if(static_cast(*it)->description().isEmpty()) + CommentsFrame *frame = dynamic_cast(*it); + + if(frame && frame->description().isEmpty()) return (*it)->toString(); }