[vlc-commits] audio_output/common.c: fix potential null-dereference

Filip Roséen git at videolan.org
Wed Jul 20 13:24:15 CEST 2016


vlc | branch: master | Filip Roséen <filip at videolabs.io> | Wed Jul 20 13:15:05 2016 +0200| [9d2a95031009a0b78405faebccbec67c7e9fa884] | committer: Thomas Guillem

audio_output/common.c: fix potential null-dereference

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

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

 src/audio_output/common.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/audio_output/common.c b/src/audio_output/common.c
index a6048ad..5e597d7 100644
--- a/src/audio_output/common.c
+++ b/src/audio_output/common.c
@@ -623,6 +623,14 @@ bool aout_ChangeFilterString( vlc_object_t *p_obj, vlc_object_t *p_aout,
         i_length += 1 + strlen( ppsz_filter[i] );
 
     char *psz_new = malloc( i_length + 1 );
+
+    if( unlikely( !psz_new ) )
+    {
+        free( ppsz_filter );
+        free( psz_list );
+        return false;
+    }
+
     *psz_new = '\0';
     for( int i = 0; i < i_count; i++ )
     {



More information about the vlc-commits mailing list