[vlc-commits] speek: fix potential NULL dereference
Rémi Denis-Courmont
git at videolan.org
Wed Aug 20 01:53:42 CEST 2014
vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Aug 18 21:06:04 2014 +0300| [0a94892c09fd19aa68567abfd5b81a284984397b] | committer: Jean-Baptiste Kempf
speek: fix potential NULL dereference
(cherry picked from commit 5dae442d8112968fc6ecb54b140d547f09ec05cd)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=0a94892c09fd19aa68567abfd5b81a284984397b
---
modules/codec/speex.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/modules/codec/speex.c b/modules/codec/speex.c
index cbfb84a..c93fbc6 100644
--- a/modules/codec/speex.c
+++ b/modules/codec/speex.c
@@ -335,11 +335,13 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( !pp_block ) return NULL;
- if( *pp_block )
+ block_t *block = *pp_block;
+
+ if( block != NULL )
{
/* Block to Ogg packet */
- oggpacket.packet = (*pp_block)->p_buffer;
- oggpacket.bytes = (*pp_block)->i_buffer;
+ oggpacket.packet = block->p_buffer;
+ oggpacket.bytes = block->i_buffer;
}
else
{
@@ -364,13 +366,15 @@ static block_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
if( CreateDefaultHeader( p_dec ) )
{
- block_Release( *pp_block );
+ if( block != NULL )
+ block_Release( block );
return NULL;
}
}
else if( ProcessHeaders( p_dec ) )
{
- block_Release( *pp_block );
+ if( block != NULL )
+ block_Release( block );
return NULL;
}
p_sys->b_has_headers = true;
More information about the vlc-commits
mailing list