From 4ee5c8e0f3944ab857648c4f800d08e929d993cd Mon Sep 17 00:00:00 2001 From: Palana Date: Mon, 1 Jun 2015 01:37:36 +0200 Subject: [PATCH] libobs: Fix crash on encoder initialization failure Found via clang static analysis --- libobs/obs-encoder.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libobs/obs-encoder.c b/libobs/obs-encoder.c index 9b0cb38ca..5cfcfd7b8 100644 --- a/libobs/obs-encoder.c +++ b/libobs/obs-encoder.c @@ -73,8 +73,9 @@ static struct obs_encoder *create_encoder(const char *id, success = init_encoder(encoder, name, settings, hotkey_data); if (!success) { + blog(LOG_ERROR, "creating encoder '%s' (%s) failed", name, id); obs_encoder_destroy(encoder); - encoder = NULL; + return NULL; } encoder->control = bzalloc(sizeof(obs_weak_encoder_t));