]> git.sesse.net Git - mlt/commitdiff
fix possible null pointer dereferences (coverity-714581)
authorDan Dennedy <dan@dennedy.org>
Fri, 17 Aug 2012 06:50:30 +0000 (23:50 -0700)
committerDan Dennedy <dan@dennedy.org>
Fri, 17 Aug 2012 06:50:30 +0000 (23:50 -0700)
src/framework/mlt_consumer.c

index b54f8dc4927277f76c3281fb19fd1662887c3328..e7abce2a97e64b876fe6335a2d3166862323d42e 100644 (file)
@@ -1187,7 +1187,7 @@ static void consumer_work_stop( mlt_consumer self )
 
 void mlt_consumer_purge( mlt_consumer self )
 {
-       if ( self->ahead )
+       if ( self && self->ahead )
        {
                pthread_mutex_lock( &self->queue_mutex );
                while ( mlt_deque_count( self->queue ) )
@@ -1464,7 +1464,7 @@ int mlt_consumer_stop( mlt_consumer self )
 int mlt_consumer_is_stopped( mlt_consumer self )
 {
        // Check if the consumer is stopped
-       if ( self->is_stopped != NULL )
+       if ( self && self->is_stopped )
                return self->is_stopped( self );
 
        return 0;