Skip to content

Commit

Permalink
Don't allow connecting a null producer to a service (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-b-m authored Apr 12, 2024
1 parent e896a41 commit b2a82de
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/framework/mlt_service.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,12 @@ int mlt_service_connect_producer(mlt_service self, mlt_service producer, int ind
}

// If we have space, assign the input
if (base->in != NULL && index >= 0 && index < base->size) {
if (producer != NULL && base->in != NULL && index >= 0 && index < base->size) {
// Get the current service
mlt_service current = (index < base->count) ? base->in[index] : NULL;

// Increment the reference count on this producer
if (producer != NULL)
mlt_properties_inc_ref(MLT_SERVICE_PROPERTIES(producer));
mlt_properties_inc_ref(MLT_SERVICE_PROPERTIES(producer));

// Now we disconnect the producer service from its consumer
mlt_service_disconnect(producer);
Expand Down

0 comments on commit b2a82de

Please sign in to comment.