summaryrefslogtreecommitdiffstats
path: root/demux/demux_lavf.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-09-08 16:16:20 +0200
committerJan Ekström <jeebjp@gmail.com>2018-10-01 18:54:54 +0300
commite74ffab36ea3d8fce4408d9d2c75142187c594c3 (patch)
tree391fef046b9b0a6c31c8b2b8db2c58325b2fb1ec /demux/demux_lavf.c
parent4f47596043121c32d1e6724db28f21aaaf6303ff (diff)
downloadmpv-e74ffab36ea3d8fce4408d9d2c75142187c594c3.tar.bz2
mpv-e74ffab36ea3d8fce4408d9d2c75142187c594c3.tar.xz
stream_libarchive: fix hangs when demuxer does out of bound seeks
This happened with a .flac file inside an archive. It tried to seek beyond the end of the archive entry in a format where seeking isn't supported. stream_libarchive handles these situations by skipping data. But when the end of the archive is reached, archive_read_data() returns 0. While libarchive didn't bother to fucking document this, they do say it's supposed to work like read(), so I guess a return value of 0 really means EOF. So change the "< 0" to "<= 0". Also add some error logging. The same file actually worked without out of bounds reads when extracted, so there still might be something very wrong. (cherry picked from commit 7e85dc2167b7524308159915d5c1d3341464977f)
Diffstat (limited to 'demux/demux_lavf.c')
0 files changed, 0 insertions, 0 deletions