id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc	blockedby	blocking	reproduced	analyzed
1904	image2: cannot open files not readable by owner	robert		"Summary of the bug:

file_check() in libavformat/file.c makes loading of image2 sequences fail (not tried with other types of files but I guess it afects all users of this function). The problem is that it checks if the owner has read permissions, but a file can be readable even when the owner has no read permissions if ""others"" have read permission. This tipically happens on Android systems, for example in the removable sdcard mounted as /mnt/sdcard.

How to reproduce:

Call avformat_open_input() with an image filename in a directory that is not readable by the owner. For example, in a directory with the following permissions: ----r-xr-x

Proposed fix:

divVerent in #ffmpeg@irc.freenode.net proposed this fix: 

{{{
static int file_check(URLContext *h, int mask)
{
    int ret = 0;
    if(mask&AVIO_FLAG_READ)
        if(access(h->filename, R_OK) >= 0)
            ret |= AVIO_FLAG_READ;
    if(mask&AVIO_FLAG_WRITE)
        if(access(h->filename, W_OK) >= 0)
            ret |= AVIO_FLAG_WRITE;
    return ret;
}
}}}
i.e use access() instead of stat(). But he says access() has issues on Windows..."	defect	closed	normal	avformat	git-master	fixed	image2				1	1
