NULL safety checks
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 16 Aug 2004 06:46:08 +0000 (06:46 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Mon, 16 Aug 2004 06:46:08 +0000 (06:46 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@365 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_consumer.c
src/framework/mlt_field.c
src/framework/mlt_filter.c
src/framework/mlt_frame.c
src/framework/mlt_multitrack.c
src/framework/mlt_playlist.c
src/framework/mlt_producer.c
src/framework/mlt_service.c
src/framework/mlt_tractor.c
src/framework/mlt_transition.c

index e6e5caf..652698f 100644 (file)
@@ -108,7 +108,7 @@ mlt_consumer mlt_consumer_new( )
 
 mlt_service mlt_consumer_service( mlt_consumer this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the consumer properties.
@@ -116,7 +116,7 @@ mlt_service mlt_consumer_service( mlt_consumer this )
 
 mlt_properties mlt_consumer_properties( mlt_consumer this )
 {
-       return mlt_service_properties( &this->parent );
+       return this != NULL ? mlt_service_properties( &this->parent ) : NULL;
 }
 
 /** Connect the consumer to the producer.
index eede159..94c4cb8 100644 (file)
@@ -78,7 +78,7 @@ mlt_field mlt_field_init( )
 
 mlt_service mlt_field_service( mlt_field this )
 {
-       return mlt_tractor_service( this->tractor );
+       return this != NULL ? mlt_tractor_service( this->tractor ) : NULL;
 }
 
 /** Get the multi track.
@@ -86,7 +86,7 @@ mlt_service mlt_field_service( mlt_field this )
 
 mlt_multitrack mlt_field_multitrack( mlt_field this )
 {
-       return this->multitrack;
+       return this != NULL ? this->multitrack : NULL;
 }
 
 /** Get the tractor.
@@ -94,7 +94,7 @@ mlt_multitrack mlt_field_multitrack( mlt_field this )
 
 mlt_tractor mlt_field_tractor( mlt_field this )
 {
-       return this->tractor;
+       return this != NULL ? this->tractor : NULL;
 }
 
 /** Get the properties associated to this field.
index 5aefd13..f140df5 100644 (file)
@@ -70,7 +70,7 @@ mlt_filter mlt_filter_new( )
 
 mlt_service mlt_filter_service( mlt_filter this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the properties associated to this filter.
index 1026deb..401c864 100644 (file)
@@ -80,7 +80,7 @@ mlt_frame mlt_frame_init( )
 
 mlt_properties mlt_frame_properties( mlt_frame this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Check if we have a way to derive something other than a test card.
index 6c24400..2c3d927 100644 (file)
@@ -78,7 +78,7 @@ mlt_multitrack mlt_multitrack_init( )
 
 mlt_producer mlt_multitrack_producer( mlt_multitrack this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the service associated this multitrack.
index 2b14358..440c924 100644 (file)
@@ -98,7 +98,7 @@ mlt_playlist mlt_playlist_init( )
 
 mlt_producer mlt_playlist_producer( mlt_playlist this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the service associated to this playlist.
index a35d134..fc161f5 100644 (file)
@@ -105,7 +105,7 @@ mlt_producer mlt_producer_new( )
 
 mlt_service mlt_producer_service( mlt_producer this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the producer properties.
index 0509b76..4a36c8d 100644 (file)
@@ -217,7 +217,7 @@ static int service_get_frame( mlt_service this, mlt_frame_ptr frame, int index )
 
 mlt_properties mlt_service_properties( mlt_service self )
 {
-       return &self->parent;
+       return self != NULL ? &self->parent : NULL;
 }
 
 /** Obtain a frame.
index 5f9c5f7..9143868 100644 (file)
@@ -83,7 +83,7 @@ mlt_service mlt_tractor_service( mlt_tractor this )
 
 mlt_producer mlt_tractor_producer( mlt_tractor this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the properties object associated to the tractor.
index 7d4bc41..afafc23 100644 (file)
@@ -72,7 +72,7 @@ mlt_transition mlt_transition_new( )
 
 mlt_service mlt_transition_service( mlt_transition this )
 {
-       return &this->parent;
+       return this != NULL ? &this->parent : NULL;
 }
 
 /** Get the properties interface.