diff options
author | wm4 <wm4@nowhere> | 2014-01-14 17:38:21 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-14 17:38:21 +0100 |
commit | 3c2f93aec850b279d47ccbb02f30f129a458d6c6 (patch) | |
tree | 753622983962b50dbd9815e88b8d3dd9ce1bb7d1 /osdep | |
parent | ae27e13a0a0d0d69ca3e91ade710ded5208f4fc6 (diff) | |
download | mpv-3c2f93aec850b279d47ccbb02f30f129a458d6c6.tar.bz2 mpv-3c2f93aec850b279d47ccbb02f30f129a458d6c6.tar.xz |
demux_mkv: improve robustness by explicitly checking for level 1 elements
Matroska makes it pretty hard to resync correctly on broken files:
random data returns "valid" EBML IDs with a high probability, and when
trying to skip them it's likely that you skip a random amount of data
(instead of considering the element length invalid).
Improve upon this by skipping known level 1 elements only. Consider
everything else invalid and call the resync code. This might result in
annoying behavior when Matroska adds new level 1 elements, although it
won't be particularly harmful. Matroska doesn't really allow us to do
better (even mkvtoolnix explicitly checks for known level 1 elements).
Since we now don't always want to combine EBML element skipping and
resyncing, remove ebml_read_skip_or_resync_cluster(), and make
ebml_read_skip() more tolerant against skipping broken elements.
Also, don't resync when reading sub-elements, and instead do resyncing
when reading them results in an error.
Diffstat (limited to 'osdep')
0 files changed, 0 insertions, 0 deletions