diff --git a/taglib/mpeg/id3v2/frames/chapterframe.cpp b/taglib/mpeg/id3v2/frames/chapterframe.cpp index 10dcc556..afe76dae 100644 --- a/taglib/mpeg/id3v2/frames/chapterframe.cpp +++ b/taglib/mpeg/id3v2/frames/chapterframe.cpp @@ -30,6 +30,7 @@ #include "tbytevectorlist.h" #include "tdebug.h" #include "tpropertymap.h" +#include "unknownframe.h" using namespace TagLib; using namespace ID3v2; @@ -259,7 +260,7 @@ void ChapterFrame::parseFields(const ByteVector &data) return; // Checks to make sure that frame parsed correctly. - if(frame->size() <= 0) { + if(frame->size() <= 0 || dynamic_cast(frame)) { delete frame; return; } diff --git a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp index 4630c6f9..805ae849 100644 --- a/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp +++ b/taglib/mpeg/id3v2/frames/tableofcontentsframe.cpp @@ -29,6 +29,7 @@ #include "tpropertymap.h" #include "tdebug.h" +#include "unknownframe.h" using namespace TagLib; using namespace ID3v2; @@ -269,7 +270,7 @@ void TableOfContentsFrame::parseFields(const ByteVector &data) return; // Checks to make sure that frame parsed correctly. - if(frame->size() <= 0) { + if(frame->size() <= 0 || dynamic_cast(frame)) { delete frame; return; }