summaryrefslogtreecommitdiffstats
path: root/demux/demux.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-12-24 06:14:10 +0100
committerMartin Herkt <652892+lachs0r@users.noreply.github.com>2017-12-24 21:33:16 +0100
commitbf111f9c3cccf0a4aefb998558cce67f9b0d6d25 (patch)
tree4ebb8730857cf01611b8f7aceaf19cad4f3c1015 /demux/demux.h
parent2a43060560a1c246943dccc77215542d6b507580 (diff)
downloadmpv-bf111f9c3cccf0a4aefb998558cce67f9b0d6d25.tar.bz2
mpv-bf111f9c3cccf0a4aefb998558cce67f9b0d6d25.tar.xz
stream_libarchive: fix seeking fallback
In commit 1199c1e3, we added checks to every libarchive API call to make sure the archive was closed on ARCHIVE_FATAL - otherwise, libarchive could endow us with free CVEs (such as it apparently happens when you continue reading a rar archive that uses features not yet supported by libarchive). This broke the fallback for seeking in unseekable archive formats. Of course libarchive won't tell us directly whether a format implementation has seek support or not - and OF COURSE it returns ARCHIVE_FATAL if it has no seek support. (The error string, which you can retrieve via API, is actually more detailed, and also claims it's an "internal error". I don't think so, libarchive.) Returning ARCHIVE_FATAL means we have to assume free CVEs are ahead, and we have to close the archive. Which breaks the fallback in a dumb way (we have no way of telling which of those cases happened anyway). Fix this by assuming that all seek errors are potentially due to lack of seek support. If the seek call fails, reopen the archive, and set a flag so the seek API is never tried again. (This means we can still skip ahead for forward seeks, which is more efficient than skipping from the start of the archive entry.) Also fix an old typo in an error message.
Diffstat (limited to 'demux/demux.h')
0 files changed, 0 insertions, 0 deletions