[vlc-commits] voc: fix skipping of unknown headers (fixes #6437)

Rémi Denis-Courmont git at videolan.org
Wed Mar 21 18:10:45 CET 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Mar 21 19:08:53 2012 +0200| [ea068351d3991a1b330eb67fb13ddbb90943e659] | committer: Rémi Denis-Courmont

voc: fix skipping of unknown headers (fixes #6437)

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

 modules/demux/voc.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/modules/demux/voc.c b/modules/demux/voc.c
index 07a9850..877b655 100644
--- a/modules/demux/voc.c
+++ b/modules/demux/voc.c
@@ -421,17 +421,18 @@ static int Demux( demux_t *p_demux )
 {
     demux_sys_t *p_sys = p_demux->p_sys;
     block_t     *p_block;
-    int64_t     i_offset, i;
-
-    i_offset = stream_Tell( p_demux->s );
-
-    while( ( i_offset >= p_sys->i_block_end )
-         && ( p_sys->i_silence_countdown == 0 ) )
-        if( ReadBlockHeader( p_demux ) != VLC_SUCCESS )
-            return 0;
+    int64_t     i;
 
     if( p_sys->i_silence_countdown == 0 )
     {
+        int64_t i_offset = stream_Tell( p_demux->s );
+        if( i_offset >= p_sys->i_block_end )
+        {
+            if( ReadBlockHeader( p_demux ) != VLC_SUCCESS )
+                return 0;
+            return 1;
+        }
+
         i = ( p_sys->i_block_end - i_offset )
             / p_sys->fmt.audio.i_bytes_per_frame;
         if( i > SAMPLES_BUFFER )



More information about the vlc-commits mailing list