demux: mkv: don't use EbmlDummy elements coming out of FindNextID()
authorSteve Lhomme <robux4@ycbcr.xyz>
Tue, 26 Nov 2024 05:33:48 +0000 (06:33 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
commit4b74b7626b18b4b6cc58debc5694655a2d956b18
tree8fe61b86aa0483f29fe70015ce97f0d4f5373d90
parent44f46a0002c0680cd34e25dda9f67d34c407d96d
demux: mkv: don't use EbmlDummy elements coming out of FindNextID()

FindNextID() is supposed to return an element of the given type when it's found. But in some cases,
when the ID and sizes are plausible, an EbmlDummy is returned [1].

We should not use that element as if it was a legit element we're looking for.
This is especially crucial when we're opening a file to decide if it's an EBML file or not (EbmlHead).

[1] https://github.com/Matroska-Org/libebml/blob/1c4e2f31b8df7f2c137d8943c73385759aae35b9/src/EbmlElement.cpp#L185

(cherry picked from commit 49d4586fe82aa105ebc1f519e8c8b7385f89c211)

Gbp-Pq: Name 0107-demux-mkv-don-t-use-EbmlDummy-elements-coming-out-of.patch
modules/demux/mkv/demux.cpp
modules/demux/mkv/matroska_segment.cpp