[vlc-commits] packetizer: mpegvideo: check sequence block duplication
Francois Cartegnie
git at videolan.org
Wed Jan 29 18:30:10 CET 2020
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Jan 29 15:44:45 2020 +0100| [dd19cc9ecc5808305f93d10e704fbade6d8cc790] | committer: Francois Cartegnie
packetizer: mpegvideo: check sequence block duplication
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=dd19cc9ecc5808305f93d10e704fbade6d8cc790
---
modules/packetizer/mpegvideo.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/modules/packetizer/mpegvideo.c b/modules/packetizer/mpegvideo.c
index d5ed7bb443..34d69e9a19 100644
--- a/modules/packetizer/mpegvideo.c
+++ b/modules/packetizer/mpegvideo.c
@@ -709,12 +709,15 @@ static block_t *ParseMPEGBlock( decoder_t *p_dec, block_t *p_frag )
if( p_sys->p_seq && p_sys->i_seq_old > i_fps )
{
/* Useful for mpeg1: repeat sequence header every second */
- block_ChainLastAppend( &p_sys->pp_last, block_Duplicate( p_sys->p_seq ) );
- if( p_sys->p_ext )
+ const block_t * params[2] = { p_sys->p_seq, p_sys->p_ext };
+ for( int i=0; i<2; i++ )
{
- block_ChainLastAppend( &p_sys->pp_last, block_Duplicate( p_sys->p_ext ) );
+ if( params[i] == NULL )
+ break;
+ block_t *p_dup = block_Duplicate( params[i] );
+ if( p_dup )
+ block_ChainLastAppend( &p_sys->pp_last, p_dup );
}
-
p_sys->i_seq_old = 0;
}
}
More information about the vlc-commits
mailing list