Enlarge MP4 atom sibling count at top level limit (#1344)

The MAX_MP4_ATOM_COUNT_PER_LEVEL of 5000 seems to be too restrictive,
a legitimate file with 5390 atoms was reported to have been rejected.
The crafted file from #1344 had 653789 atoms at the top level, which
freezed the read process for 15s on my system. Enlarging the limit
to 50000 should be sufficient and will stop the crafted file after 2s.
This commit is contained in:
Urs Fleisch
2026-07-11 09:05:17 +02:00
parent 834bf0622f
commit f09a84c4ae

View File

@@ -223,7 +223,7 @@ public:
MP4::Atoms::Atoms(File *file) :
d(std::make_unique<AtomsPrivate>())
{
static constexpr int MAX_MP4_ATOM_COUNT_PER_LEVEL = 5000;
static constexpr int MAX_MP4_ATOM_COUNT_PER_LEVEL = 50000;
d->atoms.setAutoDelete(true);