summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-01-14 17:38:21 +0100
committerwm4 <wm4@nowhere>2014-01-15 20:56:16 +0100
commita735a2abd734748aace06987632353f161e8faf5 (patch)
tree41452c9ca04e24111996256c58d1673a1de59834 /stream
parent112c1abe31674fd5f43119109f94b09d885ed357 (diff)
downloadmpv-a735a2abd734748aace06987632353f161e8faf5.tar.bz2
mpv-a735a2abd734748aace06987632353f161e8faf5.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 'stream')
0 files changed, 0 insertions, 0 deletions