Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/riffvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,31 @@ void RiffVideo::StreamName(uint64_t size_) const {

void RiffVideo::readInfoListChunk(uint64_t size_) {
uint64_t current_size = DWORD;

// Add the elements to a temporary table first, so that we can check
// for duplicates before adding them to xmpData_.
std::map<std::string, std::string> table;
while (current_size < size_) {
std::string type = readStringTag(io_);
size_t size = readDWORDTag(io_);
std::string content = readStringTag(io_, size);
<<<<<<< HEAD
if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end())
xmpData_[it->second] = content;
current_size += DWORD * 2;
current_size += size;
=======
if (auto it = Internal::infoTags.find(type); it != Internal::infoTags.end()) {
// Check that it isn't a duplicate.
Internal::enforce(table.find(it->second) == table.end(), ErrorCode::kerCorruptedMetadata);
table[it->second] = content;
}
current_size += DWORD * 2 + size;
>>>>>>> 2fee7b38 (Check for duplicates in RiffVideo::readInfoListChunk)
}
// Copy the elements from the temporary table to xmpData_.
for (const auto& it : table) {
xmpData_[it.first] = it.second;
}
}

Expand Down
Loading