[vlc-commits] decoder: fix NULL dereference when pausing packetizer
Rémi Denis-Courmont
git at videolan.org
Fri Nov 27 18:01:07 CET 2015
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Nov 27 18:59:48 2015 +0200| [34b791856b33963d785b7dad79f7c3fab29aa4f9] | committer: Rémi Denis-Courmont
decoder: fix NULL dereference when pausing packetizer
DecoderProcess() can only be used with the decoder, not the packetizer.
Inline DecoderFlush() to fix the issue.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=34b791856b33963d785b7dad79f7c3fab29aa4f9
---
src/input/decoder.c | 31 ++++++++++++++-----------------
1 file changed, 14 insertions(+), 17 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 101dda6..8be9a8c 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1264,9 +1264,21 @@ static void DecoderProcess( decoder_t *p_dec, block_t *p_block )
}
}
-static void DecoderFlush( decoder_t *p_dec )
+static void DecoderProcessFlush( decoder_t *p_dec )
{
- if ( p_dec->pf_flush )
+ decoder_owner_sys_t *p_owner = p_dec->p_owner;
+ decoder_t *p_packetizer = p_owner->p_packetizer;
+
+ if( p_dec->b_error )
+ return;
+
+ if ( p_owner->i_preroll_end == INT64_MAX )
+ return;
+
+ if( p_packetizer != NULL && p_packetizer->pf_flush != NULL )
+ p_packetizer->pf_flush( p_packetizer );
+
+ if ( p_dec->pf_flush != NULL )
p_dec->pf_flush( p_dec );
else
{
@@ -1279,21 +1291,6 @@ static void DecoderFlush( decoder_t *p_dec )
}
DecoderProcess( p_dec, p_flush );
}
-}
-
-static void DecoderProcessFlush( decoder_t *p_dec )
-{
- decoder_owner_sys_t *p_owner = p_dec->p_owner;
-
- if( p_dec->b_error )
- return;
-
- if ( p_owner->i_preroll_end == INT64_MAX )
- return;
-
- if ( p_owner->p_packetizer )
- DecoderFlush( p_owner->p_packetizer );
- DecoderFlush( p_dec );
if( p_dec->fmt_out.i_cat == AUDIO_ES )
{
More information about the vlc-commits
mailing list