lavf/aviobuf: return EINVAL when reading from a write-only context.
authorNicolas George <george@nsup.org>
Fri, 27 Oct 2017 18:46:29 +0000 (20:46 +0200)
committerJan Ekström <jeebjp@gmail.com>
Sun, 29 Oct 2017 17:40:52 +0000 (19:40 +0200)
Signed-off-by: Nicolas George <george@nsup.org>
libavformat/aviobuf.c

index bfd40f5..3b4c843 100644 (file)
@@ -529,7 +529,7 @@ static int read_packet_wrapper(AVIOContext *s, uint8_t *buf, int size)
     int ret;
 
     if (!s->read_packet)
-        return AVERROR_EOF;
+        return AVERROR(EINVAL);
     ret = s->read_packet(s->opaque, buf, size);
 #if FF_API_OLD_AVIO_EOF_0
     if (!ret && !s->max_packet_size) {