[vlc-commits] mpeg-ts: fix comparing unsigned and signed integers
    Petri Hintukainen 
    git at videolan.org
       
    Fri Dec 11 14:04:02 CET 2015
    
    
  
vlc | branch: master | Petri Hintukainen <phintuka at gmail.com> | Fri Dec 11 14:54:23 2015 +0200| [7f4fe8ff906e6bf8390dfa6a8cc6ed1e03b374a8] | committer: Jean-Baptiste Kempf
mpeg-ts: fix comparing unsigned and signed integers
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f4fe8ff906e6bf8390dfa6a8cc6ed1e03b374a8
---
 modules/demux/mpeg/ts.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index c1b4ded..cc4a7f8 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -2514,7 +2514,8 @@ static block_t* ReadTSPacket( demux_t *p_demux )
     /* Get a new TS packet */
     if( !( p_pkt = stream_Block( p_sys->stream, p_sys->i_packet_size ) ) )
     {
-        if( stream_Tell( p_sys->stream ) == stream_Size( p_sys->stream ) )
+        int64_t size = stream_Size( p_sys->stream );
+        if( size >= 0 && (uint64_t)size == stream_Tell( p_sys->stream ) )
             msg_Dbg( p_demux, "EOF at %"PRId64, stream_Tell( p_sys->stream ) );
         else
             msg_Dbg( p_demux, "Can't read TS packet at %"PRId64, stream_Tell(p_sys->stream) );
    
    
More information about the vlc-commits
mailing list