[vlc-devel] commit: ps.c: add a safety net to this while loop. (Derk-Jan Hartman )

git version control git at videolan.org
Mon Oct 6 15:01:06 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Mon Oct  6 14:59:32 2008 +0200| [f10b7234e274ae324c400fd56d4efc0a333a5877] | committer: Derk-Jan Hartman 

ps.c: add a safety net to this while loop.

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

 modules/demux/ps.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/modules/demux/ps.c b/modules/demux/ps.c
index 1a6adab..837a8ce 100644
--- a/modules/demux/ps.c
+++ b/modules/demux/ps.c
@@ -249,8 +249,9 @@ static void FindLength( demux_t *p_demux )
         i_size = stream_Size( p_demux->s );
         i_end = __MAX( 0, __MIN( 200000, i_size ) );
         stream_Seek( p_demux->s, i_size - i_end );
+        i = 0;
 
-        while( vlc_object_alive (p_demux) && Demux2( p_demux, true ) > 0 );
+        while( vlc_object_alive (p_demux) && i < 40 && Demux2( p_demux, true ) > 0 );
         if( i_current_pos >= 0 ) stream_Seek( p_demux->s, i_current_pos );
     }
 




More information about the vlc-devel mailing list