diff --git a/packager/media/base/protection_system_specific_info.cc b/packager/media/base/protection_system_specific_info.cc index 737c0b4612..0cd950f6d0 100644 --- a/packager/media/base/protection_system_specific_info.cc +++ b/packager/media/base/protection_system_specific_info.cc @@ -27,6 +27,7 @@ bool ProtectionSystemSpecificInfo::ParseBoxes( const uint8_t* data, size_t data_size, std::vector* pssh_boxes) { + pssh_boxes->clear(); BufferReader reader(data, data_size); while (reader.HasBytes(1)) { size_t start_position = reader.pos(); @@ -34,7 +35,7 @@ bool ProtectionSystemSpecificInfo::ParseBoxes( RCHECK(reader.Read4(&size)); RCHECK(reader.SkipBytes(size - 4)); - pssh_boxes->emplace_back(); + pssh_boxes->push_back(ProtectionSystemSpecificInfo()); RCHECK(pssh_boxes->back().Parse(data + start_position, size)); }