[FFmpeg-cvslog] avformat/file: use proper return value in file_close

Marton Balint git at videolan.org
Sun Dec 12 01:39:50 EET 2021


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Nov 30 00:50:16 2021 +0100| [722d28db129b2e52d19c1a5051ea4ab0a9b84062] | committer: Marton Balint

avformat/file: use proper return value in file_close

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=722d28db129b2e52d19c1a5051ea4ab0a9b84062
---

 libavformat/file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/file.c b/libavformat/file.c
index 9c23f680cd..7001750c80 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -266,7 +266,8 @@ static int64_t file_seek(URLContext *h, int64_t pos, int whence)
 static int file_close(URLContext *h)
 {
     FileContext *c = h->priv_data;
-    return close(c->fd);
+    int ret = close(c->fd);
+    return (ret == -1) ? AVERROR(errno) : 0;
 }
 
 static int file_open_dir(URLContext *h)



More information about the ffmpeg-cvslog mailing list