diff mbox

[FFmpeg-devel,3/3] lavf/aviobuf: return EINVAL when reading from a write-only context.

Message ID 20171027184629.20772-3-george@nsup.org
State Accepted
Commit 158a79c31d55d0b82ff3f514c586f5be033ad0c2
Headers show

Commit Message

Nicolas George Oct. 27, 2017, 6:46 p.m. UTC
Signed-off-by: Nicolas George <george@nsup.org>
---
 libavformat/aviobuf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jan Ekström Oct. 27, 2017, 6:57 p.m. UTC | #1
On Fri, Oct 27, 2017 at 9:46 PM, Nicolas George <george@nsup.org> wrote:
> Signed-off-by: Nicolas George <george@nsup.org>
> ---

LGTM

Jan
diff mbox

Patch

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index bfd40f5097..3b4c8439d6 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -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) {