]> git.sesse.net Git - vlc/commitdiff
* modules/packetizer/mpegvideo.c: When a discontinuity is flagged, trash
authorChristophe Massiot <massiot@videolan.org>
Wed, 21 Apr 2004 16:00:17 +0000 (16:00 +0000)
committerChristophe Massiot <massiot@videolan.org>
Wed, 21 Apr 2004 16:00:17 +0000 (16:00 +0000)
  the whole PES because the contents may be corrupt.

modules/packetizer/mpegvideo.c

index 4857e21a177d640fc69cd73cbe73cb6950f6cbf8..5c7f9cbf0fba4302183b121e916ffcae38b8559d 100644 (file)
@@ -2,7 +2,7 @@
  * mpegvideo.c: parse and packetize an MPEG1/2 video stream
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mpegvideo.c,v 1.31 2004/03/03 11:09:30 massiot Exp $
+ * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *          Eric Petit <titer@videolan.org>
@@ -211,12 +211,14 @@ static block_t *Packetize( decoder_t *p_dec, block_t **pp_block )
         return NULL;
     }
 
-    if( (*pp_block)->i_flags&BLOCK_FLAG_DISCONTINUITY )
+    if( (*pp_block)->i_flags & BLOCK_FLAG_DISCONTINUITY )
     {
         p_sys->i_state = STATE_NOSYNC;
         if( p_sys->p_frame ) block_ChainRelease( p_sys->p_frame );
         p_sys->p_frame = NULL;
         p_sys->b_frame_slice = VLC_FALSE;
+        block_Release( *pp_block );
+        return NULL;
     }
 
     block_BytestreamPush( &p_sys->bytestream, *pp_block );