LibMedia: Stop overwriting top level element positions in Matroska

By not specifying HashSetExistingEntryBehavior::Keep, we were
overwriting the first cluster's position with a later cluster in files
that don't have a seek head element specifying the first cluster before
the first cluster element in the file. This caused us to seek to the
last cluster instead of the first one in some files.
This commit is contained in:
Zaggy1024 2025-12-03 13:11:51 -06:00 committed by Gregory Bertilson
parent 7669cffabc
commit 9e2b674da5

View file

@ -298,7 +298,7 @@ DecoderErrorOr<Optional<size_t>> Reader::find_first_top_level_element_with_id([[
m_last_top_level_element_position = streamer.position();
DECODER_TRY_ALLOC(m_seek_entries.try_set(found_element_id, found_element_position));
DECODER_TRY_ALLOC(m_seek_entries.try_set(found_element_id, found_element_position, AK::HashSetExistingEntryBehavior::Keep));
if (found_element_id == element_id) {
position = found_element_position;