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

index b23f1ff3230e7b4d0836f1c44c6929e89726c619..3b8dcf3233bd016fa196f5f13aa359e527822710 100644 (file)
@@ -998,6 +998,10 @@ void hb_lock_close( hb_lock_t ** _l )
 {
     hb_lock_t * l = *_l;
 
+    if (l == NULL)
+    {
+        return;
+    }
 #if defined( SYS_BEOS )
     delete_sem( l->sem );
 #elif USE_PTHREAD
@@ -1077,6 +1081,10 @@ void hb_cond_close( hb_cond_t ** _c )
 {
     hb_cond_t * c = *_c;
 
+    if (c == NULL)
+    {
+        return;
+    }
 #if defined( SYS_BEOS )
 #elif USE_PTHREAD
     pthread_cond_destroy( &c->cond );