Ensure attachments have been parsed before making MKV file

This commit is contained in:
Martchus 2021-02-01 17:10:29 +01:00
parent 78439e2e3f
commit 709b4a409f
1 changed files with 8 additions and 0 deletions

View File

@ -851,6 +851,14 @@ void MatroskaContainer::internalMakeFile(Diagnostics &diag, AbortableProgressFee
diag.emplace_back(DiagLevel::Critical, "The header has not been parsed yet.", context);
throw InvalidDataException();
}
switch (fileInfo().attachmentsParsingStatus()) {
case ParsingStatus::Ok:
case ParsingStatus::NotSupported:
break;
default:
diag.emplace_back(DiagLevel::Critical, "Attachments have to be parsed without critical errors before changes can be applied.", context);
throw InvalidDataException();
}
// define variables for parsing the elements of the original file
EbmlElement *level0Element = firstElement();