Debug Assertion error while adding cover art to a MP4 file
Thomas
tosate at gmail.com
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
problem.
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?
Cheers,
Thomas
From: Thomas Salm [mailto:tosate at gmail.com]
Sent: Sunday, February 09, 2014 10:18 PM
To: taglib-devel at kde.org
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:
----------------------------------------------------------------------
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/20140220/aa6ea77f/attachment.html>
More information about the taglib-devel
mailing list