Problem with FrameList and casting

Jeff Mitchell kde-dev at emailgoeshere.com
Sat Aug 9 00:47:17 CEST 2008


I'm hitting a problem with the following code, running on an open and 
valid file.

TagLib::ID3v2::FrameList frameList = 
file->ID3v2Tag()->frameListMap()["UFID"];

qDebug() << "framelist size is " << frameList.size();

TagLib::ID3v2::FrameList::Iterator iter;
for( iter = frameList.begin(); iter != frameList.end(); ++iter )
{
     TagLib::ID3v2::UniqueFileIdentifierFrame* currFrame = 
dynamic_cast<TagLib::ID3v2::UniqueFileIdentifierFrame*>(*iter);

if( currFrame )
.....

The output is "framelist size is 1" (which is right, because eyeD3 
confirms this, and I used taglib to write the frame in the same program 
in an earlier run).

However, I get segfaults on that dynamic_cast line.  No idea why.

This exact code used to work for me, in code from about 2 years ago. 
Could this be a regression?  If not, what am I doing wrong?

Thanks,
Jeff


More information about the taglib-devel mailing list