[vlc-commits] demux:avi: the length cannot be negative

Steve Lhomme git at videolan.org
Wed Sep 19 15:46:28 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Jun  6 15:43:52 2018 +0200| [78268a9a2c879c6c6b679c529a766e62b25ab723] | committer: Steve Lhomme

demux:avi: the length cannot be negative

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

 modules/demux/avi/avi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 181b10d3d4..52e048d9fa 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -948,7 +948,7 @@ static int Demux_Seekable( demux_t *p_demux )
         int64_t i_length = vlc_tick_from_sec( p_sys->i_length );
 
         p_sys->i_time += p_sys->i_read_increment;
-        if( i_length > 0 )
+        if( p_sys->i_length != 0 )
         {
             if( p_sys->i_time >= i_length )
                 return VLC_DEMUXER_EOF;
@@ -1449,7 +1449,7 @@ static int Seek( demux_t *p_demux, vlc_tick_t i_date, double f_ratio, bool b_acc
             p_sys->b_indexloaded = true; /* we don't want to try each time */
         }
 
-        if( !p_sys->i_length )
+        if( p_sys->i_length == 0 )
         {
             avi_track_t *p_stream = NULL;
             unsigned i_stream = 0;
@@ -1574,7 +1574,7 @@ static double ControlGetPosition( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
 
-    if( p_sys->i_length > 0 )
+    if( p_sys->i_length != 0 )
     {
         return (double)p_sys->i_time / (double)( p_sys->i_length * (vlc_tick_t)CLOCK_FREQ );
     }
@@ -1632,7 +1632,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             {
                 return VLC_EGENERIC;
             }
-            else if( p_sys->i_length > 0 )
+            else if( p_sys->i_length != 0 )
             {
                 f = (double)i64 / (p_sys->i_length*CLOCK_FREQ);
             }



More information about the vlc-commits mailing list