]> git.sesse.net Git - mlt/commitdiff
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 e6e5caf838bef068e3b97d8180b60111da3d1021..652698f968a60476111ce1a37591a2e9e3890000 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 eede159b871292add65de218fd80a819633d19b6..94c4cb8bb752ae098cc380daa691df811889bebf 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 5aefd13b015580396ff4bc671fcb046c59d12ba1..f140df52658eb011bc45e0651f4a02d3180264a9 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 1026debf9e63e1928c930a36efacea83ea2df99f..401c8647ea230cf897dd6adcb252831961713878 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 6c24400f243993175a9c42b76ae8c66e3d9fd9c8..2c3d927b0b59c12da543d0ad8af7c48e74e7e127 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 2b1435845964db5fba451e0581b695b3903e292a..440c92459c98db83658ecb9746dd388e702dd03a 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 a35d134ea453f762d0b93b4556c53eb3d7d608e8..fc161f5d534c90b28631f19d99fb90394802eb97 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 0509b767cc43eab9810483df24aeb4f4fcc4b282..4a36c8d8830471007c0bbf22fb83682bd2cc9566 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 5f9c5f7d75fb1da042d83aa0ff8f3fc8f7bbd12f..91438680064e1d3147851decbb625ca7516bdd66 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 7d4bc417d026236aef9770987d07573d78b8fa0d..afafc230aae2aa8fd5f591fbc6da044aa22cf910 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.