[vlc-devel] commit: Fix potential invalid sout buffer chain in decoder. (Laurent Aimar )

git version control git at videolan.org
Wed Nov 19 19:54:58 CET 2008


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Wed Nov 19 19:45:03 2008 +0100| [ef2bc53a5aa891f513dcba342b21bdd1fe1b3303] | committer: Laurent Aimar 

Fix potential invalid sout buffer chain in decoder.

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

 src/input/decoder.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 1abbc45..93b27c0 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1532,13 +1532,12 @@ static void DecoderPlaySout( decoder_t *p_dec, block_t *p_sout_block,
     decoder_owner_sys_t *p_owner = p_dec->p_owner;
 
     assert( p_owner->p_clock );
+    assert( !p_sout_block->p_next );
 
     vlc_mutex_lock( &p_owner->lock );
 
     if( p_owner->b_buffering || p_owner->buffer.p_block )
     {
-        p_sout_block->p_next = NULL;
-
         block_ChainLastAppend( &p_owner->buffer.pp_block_next, p_sout_block );
 
         p_owner->buffer.i_count++;
@@ -1574,6 +1573,7 @@ static void DecoderPlaySout( decoder_t *p_dec, block_t *p_sout_block,
             if( !b_has_more )
                 p_owner->buffer.pp_block_next = &p_owner->buffer.p_block;
         }
+        p_sout_block->p_next = NULL;
 
         DecoderFixTs( p_dec, &p_sout_block->i_dts, &p_sout_block->i_pts,
                       &p_sout_block->i_length,




More information about the vlc-devel mailing list