[vlc-commits] access: archive: don't ignore error codes of archive_read_data()

Hannes Domani git at videolan.org
Tue Jul 28 09:10:14 CEST 2015


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Tue Jul 28 10:10:01 2015 +0300| [70a66966eba59350f3b768db72b262b238ffa7cf] | committer: Rémi Denis-Courmont

access: archive: don't ignore error codes of archive_read_data()

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=70a66966eba59350f3b768db72b262b238ffa7cf
---

 modules/access/archive/access.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/access/archive/access.c b/modules/access/archive/access.c
index 64c2445..aaa6ade 100644
--- a/modules/access/archive/access.c
+++ b/modules/access/archive/access.c
@@ -51,12 +51,14 @@ static ssize_t Read(access_t *p_access, uint8_t *p_data, size_t i_size)
 {
     access_sys_t *p_sys = p_access->p_sys;
 
-    size_t i_read = 0;
+    ssize_t i_read = 0;
 
     i_read = archive_read_data(p_sys->p_archive, p_data, i_size);
 
     if (i_read > 0)
         p_access->info.i_pos += i_read;
+    else
+        i_read = 0;
 
     if (i_size > 0 && i_read <= 0)
         p_access->info.b_eof = true;



More information about the vlc-commits mailing list