[vlc-commits] update: correct check for update file size

Rémi Denis-Courmont git at videolan.org
Mon Aug 31 19:13:09 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 31 20:10:30 2015 +0300| [afceeaf90eac02f5bc7530762584b9177f0b7a43] | committer: Rémi Denis-Courmont

update: correct check for update file size

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

 src/misc/update.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/misc/update.c b/src/misc/update.c
index 9c8f979..58fbabb 100644
--- a/src/misc/update.c
+++ b/src/misc/update.c
@@ -192,9 +192,8 @@ static bool GetUpdateFile( update_t *p_update )
         goto error;
     }
 
-    const int64_t i_read = stream_Size( p_stream );
-
-    if( i_read < 0 || i_read >= UINT16_MAX)
+    uint64_t i_read;
+    if( stream_GetSize( p_stream, &i_read ) || i_read >= UINT16_MAX )
     {
         msg_Err(p_update->p_libvlc, "Status file too large");
         goto error;
@@ -204,7 +203,7 @@ static bool GetUpdateFile( update_t *p_update )
     if( !psz_update_data )
         goto error;
 
-    if( stream_Read( p_stream, psz_update_data, i_read ) != i_read )
+    if( stream_Read( p_stream, psz_update_data, i_read ) != (ssize_t)i_read )
     {
         msg_Err( p_update->p_libvlc, "Couldn't download update file %s",
                 UPDATE_VLC_STATUS_URL );



More information about the vlc-commits mailing list