Debug Assertion error while adding cover art to a MP4 file
Thomas Salm
tosate at gmail.com
Sun Feb 9 21:18:17 UTC 2014
Hi there,
I am using taglib for a Windows application and I am trying to add cover
art to a MP4 file. Unfortunately I am getting a "Debug Assertion Failed!"
error from the Microsoft Visual C++ Runtime Library.
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c
Line: 1424
Expression: _pFirstBlock == pHead
I have already had such an error when I tried to delete an object which was
already destructed by the library.
Here is my code snipped:
----------------------------------------------------------------------
if(mp4File->isValid())
{
TagLib::MP4::Tag *mp4Tag = mp4File->tag();
TagLib::MP4::ItemListMap itemListMap = mp4Tag->itemListMap();
TagLib::MP4::CoverArtList coverArtList =
itemListMap["covr"].toCoverArtList();
coverArtList.clear();
for(std::vector<EmbeddedPicture*>::iterator it =
this->embeddedPictures->begin(); it != this->embeddedPictures->end(); ++it)
{
MP4CoverArt *mp4CoverArt = (MP4CoverArt*)*it;
TagLib::MP4::CoverArt coverArt(mp4CoverArt->Format(), mp4CoverArt->Data());
coverArtList.append(coverArt);
}
itemListMap.insert("covr", coverArtList);
mp4File->save();
}
----------------------------------------------------------------------
The error appears as soon as the method is left. In my opinion the CoverArt
object which is created and added to the ItemListMap exists on the stack
and is gone when the method finishes. However creating the object on the
heap by using the new operator did not help.
Do you have any ideas?
Cheers,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/taglib-devel/attachments/20140209/a11055e5/attachment.html>
More information about the taglib-devel
mailing list