aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2018-05-28 03:21:35 +0300
committerJan Ekström <jeebjp@gmail.com>2018-05-28 20:33:50 +0300
commit26892c7615395f331f6143535f03a2957973e2e0 (patch)
treefeccd3fa0a2ae2441b548f7ac240cb9b843ba6ab
parent81b77e7bf16a754005a2af7e5cf35e2eefc91a39 (diff)
downloadffmpeg-26892c7615395f331f6143535f03a2957973e2e0.tar.gz
lavf/libssh: translate a read of 0 to EOF
Yet another case of forgotten 0 =! EOF translation. While the documentation for this specific synchronous read function does not mention it, the documentation for `sftp_async_read` documents it, as well as looking at the implementation of this function leads one to find `if (handle->eof) { return 0; }`. Reported by stnutt on IRC.
-rw-r--r--libavformat/libssh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/libssh.c b/libavformat/libssh.c
index 9e3d4da45e..21474f0f0a 100644
--- a/libavformat/libssh.c
+++ b/libavformat/libssh.c
@@ -295,7 +295,7 @@ static int libssh_read(URLContext *h, unsigned char *buf, int size)
av_log(libssh, AV_LOG_ERROR, "Read error.\n");
return AVERROR(EIO);
}
- return bytes_read;
+ return bytes_read ? bytes_read : AVERROR_EOF;
}
static int libssh_write(URLContext *h, const unsigned char *buf, int size)