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:
Urs Fleisch
2026-02-15 08:38:14 +01:00
committed by GitHub
parent f4117f873c
commit b7f0225f0d
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}