demux_libarchive: reject 0-sized files

libarchive does strange things with them.
This commit is contained in:
wm4 2015-08-18 00:14:37 +02:00
parent cf2fa9d3e5
commit da8a9ff589
1 changed files with 3 additions and 0 deletions

View File

@ -32,6 +32,9 @@ static int cmp_filename(const void *a, const void *b)
static int open_file(struct demuxer *demuxer, enum demux_check check)
{
if (stream_get_size(demuxer->stream) == 0)
return -1;
int flags = 0;
if (check <= DEMUX_CHECK_REQUEST)
flags |= MP_ARCHIVE_FLAG_UNSAFE;