aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2011-04-20 17:09:46 +0300
committerAnton Khirnov <anton@khirnov.net>2011-04-20 17:00:11 +0200
commit26f6b8c571bcff7b325c7d6cc226c625dd465f8e (patch)
tree0fa2b9a0bce95790fc7b75cb2ad7242483e9027f
parent7bbb67d58005f3c0384f657570fabcdc0bc8cc21 (diff)
downloadffmpeg-26f6b8c571bcff7b325c7d6cc226c625dd465f8e.tar.gz
avio: Fix sanity checks in ffurl_read*
This fixes e.g. reading data over HTTP, where the underlying socket is set to read/write. Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r--libavformat/avio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 074d3eeb86..0702aff007 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -289,14 +289,14 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
int ffurl_read(URLContext *h, unsigned char *buf, int size)
{
- if (h->flags & AVIO_FLAG_WRITE)
+ if (!(h->flags & AVIO_FLAG_READ))
return AVERROR(EIO);
return retry_transfer_wrapper(h, buf, size, 1, h->prot->url_read);
}
int ffurl_read_complete(URLContext *h, unsigned char *buf, int size)
{
- if (h->flags & AVIO_FLAG_WRITE)
+ if (!(h->flags & AVIO_FLAG_READ))
return AVERROR(EIO);
return retry_transfer_wrapper(h, buf, size, size, h->prot->url_read);
}