]> granicus.if.org Git - handbrake/commitdiff
libhb: add some NULL checks
authorJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 16 Nov 2015 00:07:13 +0000 (16:07 -0800)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Mon, 16 Nov 2015 00:07:13 +0000 (16:07 -0800)
libhb/common.c

index 43c4d76012971c5d8d55cc691390cbe0efa121d0..044e7510907527437dd2247d830528b97b6de0d7 100644 (file)
@@ -2843,6 +2843,7 @@ void hb_buffer_list_close(hb_buffer_list_t *list)
 
 int hb_buffer_list_count(hb_buffer_list_t *list)
 {
+    if (list == NULL) return 0;
     return list->count;
 }
 
@@ -2894,6 +2895,7 @@ hb_list_t * hb_list_init()
  *********************************************************************/
 int hb_list_count( const hb_list_t * l )
 {
+    if (l == NULL) return 0;
     return l->items_count;
 }
 
@@ -3120,7 +3122,9 @@ void hb_list_close( hb_list_t ** _l )
     hb_list_t * l = *_l;
 
     if (l == NULL)
+    {
         return;
+    }
 
     free( l->items );
     free( l );