Skip to content

Commit e81f052

Browse files
committed
Fix possible deadlock condition
1 parent 37e0103 commit e81f052

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/framework/mlt_property.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,7 +1565,6 @@ char *mlt_property_anim_get_string(
15651565
mlt_property_close(item.property);
15661566
pthread_mutex_unlock(&self->mutex);
15671567
} else {
1568-
pthread_mutex_unlock(&self->mutex);
15691568
const char *raw = mlt_property_get_string_l(self, locale);
15701569
if (raw && raw[0] == '"') {
15711570
size_t len = strlen(raw);
@@ -1577,19 +1576,18 @@ char *mlt_property_anim_get_string(
15771576
char *unquoted = malloc(len - 1);
15781577
memcpy(unquoted, raw + 1, len - 2);
15791578
unquoted[len - 2] = '\0';
1580-
pthread_mutex_lock(&self->mutex);
15811579
if (self->destructor)
15821580
self->destructor(self->data);
15831581
self->data = unquoted;
15841582
self->destructor = free;
15851583
result = (char *) self->data;
1586-
pthread_mutex_unlock(&self->mutex);
15871584
} else {
15881585
result = (char *) raw;
15891586
}
15901587
} else {
15911588
result = (char *) raw;
15921589
}
1590+
pthread_mutex_unlock(&self->mutex);
15931591
}
15941592
return result;
15951593
}

0 commit comments

Comments
 (0)