[vlc-commits] input: check malloc return

Jean-Baptiste Kempf git at videolan.org
Thu Apr 30 15:22:39 CEST 2015


vlc/vlc-2.2 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Apr 28 15:09:57 2015 +0200| [1743fe56e00bbfc25603f88b7851fd35b8881260] | committer: Jean-Baptiste Kempf

input: check malloc return

(cherry picked from commit 46437d4aa3300b99dbfe29f6f2d1fa8fcf64155d)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 include/vlc_input.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index 6ec305b..13a944a 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -53,6 +53,8 @@ struct seekpoint_t
 static inline seekpoint_t *vlc_seekpoint_New( void )
 {
     seekpoint_t *point = (seekpoint_t*)malloc( sizeof( seekpoint_t ) );
+    if( !point )
+        return NULL;
     point->i_byte_offset =
     point->i_time_offset = -1;
     point->psz_name = NULL;
@@ -96,6 +98,8 @@ typedef struct input_title_t
 static inline input_title_t *vlc_input_title_New(void)
 {
     input_title_t *t = (input_title_t*)malloc( sizeof( input_title_t ) );
+    if( !t )
+        return NULL;
 
     t->psz_name = NULL;
     t->b_menu = false;



More information about the vlc-commits mailing list