Add missing mutex unlock on error

Fixes #1770 <https://github.com/Genymobile/scrcpy/issues/1770>

Reported-by: lordnn
This commit is contained in:
Romain Vimont 2020-09-20 01:07:18 +02:00
parent d662f73bdc
commit a65ebceac1

View file

@ -361,12 +361,14 @@ recorder_push(struct recorder *recorder, const AVPacket *packet) {
if (recorder->failed) {
// reject any new packet (this will stop the stream)
mutex_unlock(recorder->mutex);
return false;
}
struct record_packet *rec = record_packet_new(packet);
if (!rec) {
LOGC("Could not allocate record packet");
mutex_unlock(recorder->mutex);
return false;
}