From: lilo_booter Date: Mon, 16 Aug 2004 06:46:08 +0000 (+0000) Subject: NULL safety checks X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=4db14da139d0cce1807d5f3530b271238786b795;p=melted NULL safety checks git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@365 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/framework/mlt_consumer.c b/src/framework/mlt_consumer.c index e6e5caf..652698f 100644 --- a/src/framework/mlt_consumer.c +++ b/src/framework/mlt_consumer.c @@ -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. diff --git a/src/framework/mlt_field.c b/src/framework/mlt_field.c index eede159..94c4cb8 100644 --- a/src/framework/mlt_field.c +++ b/src/framework/mlt_field.c @@ -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. diff --git a/src/framework/mlt_filter.c b/src/framework/mlt_filter.c index 5aefd13..f140df5 100644 --- a/src/framework/mlt_filter.c +++ b/src/framework/mlt_filter.c @@ -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. diff --git a/src/framework/mlt_frame.c b/src/framework/mlt_frame.c index 1026deb..401c864 100644 --- a/src/framework/mlt_frame.c +++ b/src/framework/mlt_frame.c @@ -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. diff --git a/src/framework/mlt_multitrack.c b/src/framework/mlt_multitrack.c index 6c24400..2c3d927 100644 --- a/src/framework/mlt_multitrack.c +++ b/src/framework/mlt_multitrack.c @@ -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. diff --git a/src/framework/mlt_playlist.c b/src/framework/mlt_playlist.c index 2b14358..440c924 100644 --- a/src/framework/mlt_playlist.c +++ b/src/framework/mlt_playlist.c @@ -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. diff --git a/src/framework/mlt_producer.c b/src/framework/mlt_producer.c index a35d134..fc161f5 100644 --- a/src/framework/mlt_producer.c +++ b/src/framework/mlt_producer.c @@ -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. diff --git a/src/framework/mlt_service.c b/src/framework/mlt_service.c index 0509b76..4a36c8d 100644 --- a/src/framework/mlt_service.c +++ b/src/framework/mlt_service.c @@ -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. diff --git a/src/framework/mlt_tractor.c b/src/framework/mlt_tractor.c index 5f9c5f7..9143868 100644 --- a/src/framework/mlt_tractor.c +++ b/src/framework/mlt_tractor.c @@ -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. diff --git a/src/framework/mlt_transition.c b/src/framework/mlt_transition.c index 7d4bc41..afafc23 100644 --- a/src/framework/mlt_transition.c +++ b/src/framework/mlt_transition.c @@ -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.