avio: fix AVIO_FLAG_READ/WRITE test in ffurl_*.
authorNicolas George <nicolas.george@normalesup.org>
Wed, 20 Apr 2011 16:13:54 +0000 (18:13 +0200)
committerNicolas George <nicolas.george@normalesup.org>
Wed, 20 Apr 2011 16:13:54 +0000 (18:13 +0200)
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
libavformat/avio.c

index 0a09cf1..936a3d9 100644 (file)
@@ -287,14 +287,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);
 }