[vlc-commits] vlc_input: check malloc return

Zhao Zhili git at videolan.org
Wed Dec 16 21:31:18 CET 2015


vlc | branch: master | Zhao Zhili <wantlamy at gmail.com> | Sun Dec 13 12:15:53 2015 +0800| [bb931e14160280686510577678fff760ec8730c1] | committer: Rémi Denis-Courmont

vlc_input: check malloc return

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

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

 include/vlc_input.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index f6209e3..fbe7f79 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -190,7 +190,7 @@ static inline input_attachment_t *vlc_input_attachment_New( const char *psz_name
     a->psz_description = strdup( psz_description ? psz_description : "" );
     a->i_data = i_data;
     a->p_data = malloc( i_data );
-    if( i_data > 0 && likely(p_data != NULL) )
+    if( i_data > 0 && likely(a->p_data != NULL) )
         memcpy( a->p_data, p_data, i_data );
 
     if( unlikely(a->psz_name == NULL || a->psz_mime == NULL



More information about the vlc-commits mailing list