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, 14 Jan 2025 22:09:47 +0000 (23:09 +0100)
commit7074083818c7d10ec6301f54e731fce0f9f54e94
tree4098a06d5cb472bcc967c10d2b03cd1c91015a41
parentf0e3e12ef18f62c6bf8665e1e6a79d03195b4bca
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