Debug Assertion error while adding cover art to a MP4 file

Thomas tosate at
Thu Feb 20 18:37:54 UTC 2014

Hi there,


after several hours of debugging, reading other's code and refactoring my
application, I come to the conclusion that Visual Studio 2012 Express is the

If I build my application in Debug mode, I get the described Debug Assertion
error. In Release mode, I get access violations in other parts of my code
and further development is difficult since debugging isn't possible.

I have restarted with new project files and I have reviewed the
configurations, but I couldn't find any solution.


Finally, I switched to Visual Studio 2005 Professional and suddenly all
errors are gone. I have no clue whether the problems are caused by the
limitations of Visual Studio Express (free limited IDE edition) or if there
is a general problem with Visual Studio 2012.

I am using TagLib for a hobby project and I have no access to a license of a
recent Visual Studio version.


Does anyone else uses TagLib in recent VS versions? Or do you recommend
another IDE for Windows?





From: Thomas Salm [mailto:tosate at] 
Sent: Sunday, February 09, 2014 10:18 PM
To: taglib-devel at
Subject: Debug Assertion error while adding cover art to a MP4 file


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:




                                   TagLib::MP4::Tag *mp4Tag =


                                   TagLib::MP4::ItemListMap itemListMap =

                                   TagLib::MP4::CoverArtList coverArtList =




for(std::vector<EmbeddedPicture*>::iterator it =
this->embeddedPictures->begin(); it != this->embeddedPictures->end(); ++it)


                                               MP4CoverArt *mp4CoverArt =

coverArt(mp4CoverArt->Format(), mp4CoverArt->Data());



                                   itemListMap.insert("covr", coverArtList);






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?




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the taglib-devel mailing list