Browse files

Fix possible deadlock in kdenlivetitle (coverity-1215697).

  • Loading branch information...
1 parent 6a3c292 commit ecbda4a5ae7c7268739828b19421724c61ce77e1 @ddennedy ddennedy committed May 24, 2014
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/modules/qt/kdenlivetitle_wrapper.cpp
View
8 src/modules/qt/kdenlivetitle_wrapper.cpp
@@ -355,8 +355,8 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame frame, int width, int he
// Obtain properties of frame
mlt_properties properties = MLT_FRAME_PROPERTIES( frame );
-
- pthread_mutex_lock( &self->mutex );
+
+ pthread_mutex_lock( &self->mutex );
// Check if user wants us to reload the image
if ( mlt_properties_get( producer_props, "_animated" ) != NULL || force_refresh == 1 || width != self->current_width || height != self->current_height || mlt_properties_get( producer_props, "_endrect" ) != NULL )
@@ -379,8 +379,10 @@ void drawKdenliveTitle( producer_ktitle self, mlt_frame frame, int width, int he
if ( scene == NULL )
{
- if ( !createQApplicationIfNeeded( MLT_PRODUCER_SERVICE(producer) ) )
+ if ( !createQApplicationIfNeeded( MLT_PRODUCER_SERVICE(producer) ) ) {
+ pthread_mutex_unlock( &self->mutex );
return;
+ }
if ( !QMetaType::type("QTextCursor") )
qRegisterMetaType<QTextCursor>( "QTextCursor" );
scene = new QGraphicsScene();

0 comments on commit ecbda4a

Please sign in to comment.