mirror of
https://github.com/taglib/taglib.git
synced 2026-02-21 23:53:02 -05:00
Do not allow unknown frames embedded in CTOC and CHAP (#1306)
This prevents the parsing of frames with specially constructed recursive frame hierarchies from taking an extremely long time.
This commit is contained in:
@ -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<UnknownFrame *>(frame)) {
|
||||
delete frame;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -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<UnknownFrame *>(frame)) {
|
||||
delete frame;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user