[vlc-commits] oggseek: check the length is not VLC_TICK_INVALID explicitly

Steve Lhomme git at videolan.org
Wed Sep 19 13:23:50 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Thu May 31 16:20:34 2018 +0200| [edbbefd9eb9a93714584a92006d976ee6d7c7fd4] | committer: Steve Lhomme

oggseek: check the length is not VLC_TICK_INVALID explicitly

it cannot be negative

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

 modules/demux/oggseek.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/demux/oggseek.c b/modules/demux/oggseek.c
index 190bf5c7b6..6fcb029dea 100644
--- a/modules/demux/oggseek.c
+++ b/modules/demux/oggseek.c
@@ -284,16 +284,16 @@ void Oggseek_ProbeEnd( demux_t *p_demux )
 
                     i_length = Ogg_GranuleToTime( p_sys->pp_stream[i], i_granule,
                                                   !p_sys->pp_stream[i]->b_contiguous, false );
-                    if( i_length > VLC_TICK_INVALID )
+                    if( i_length != VLC_TICK_INVALID )
                         p_sys->i_length = __MAX( p_sys->i_length, SEC_FROM_VLC_TICK(i_length - VLC_TICK_0) );
                     break;
                 }
             }
-            if ( i_length > VLC_TICK_INVALID ) break;
+            if ( i_length != VLC_TICK_INVALID ) break;
         }
 
         /* We found at least a page with valid granule */
-        if ( i_length > VLC_TICK_INVALID ) break;
+        if ( i_length != VLC_TICK_INVALID ) break;
 
         /* Otherwise increase read size, starting earlier */
         if ( i_backoffset <= ( UINT_MAX >> 1 ) )



More information about the vlc-commits mailing list