mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
It is possible for a file table to contain multiple entries for the same file, each with a different volume. This is valid, and means that the file can be extracted from multiple .cab files. However, sometimes the header can report a file as existing in multiple volumes despite it not actually being present in all of them. The previous policy when encountering duplicate entries was to just overwrite, which effectively resulted in us keeping the last encountered entry, which would be for the highest volume id. However, when an erroneous entry mentioned above was encountered, extraction would fail. This commit makes it so we now keep the entry with the lowest volume id, and discard the rest.