diff --git a/src/ass_file.cpp b/src/ass_file.cpp index 9d07b6220..2e6a8b712 100644 --- a/src/ass_file.cpp +++ b/src/ass_file.cpp @@ -259,9 +259,9 @@ void AssFile::CleanExtradata() { // Then remove all IDs found to be in use from this list // Remaining is then all garbage IDs std::vector ids; - for (auto& it : Extradata) { + for (auto& it : Extradata) ids.push_back(it.first); - } + if (ids.empty()) return; // For each line, find which IDs it actually uses and remove them from the unused-list for (auto& line : Events) {