Commit 9bf8997a authored by hpi1's avatar hpi1

fix crash when disc_init() fails

Not likely, but possible (failed malloc would cause this).
parent ed345b0c
......@@ -1300,16 +1300,20 @@ BLURAY *bd_open(const char *device_path, const char *keyfile_path)
return NULL;
}
bd_mutex_init(&bd->mutex);
#ifdef USING_BDJAVA
bd_mutex_init(&bd->argb_buffer_mutex);
#endif
bd->disc = disc_open(device_path,
&enc_info, keyfile_path,
(void*)bd->regs, (void*)bd_psr_read, (void*)bd_psr_write);
_fill_disc_info(bd, &enc_info);
if (!bd->disc) {
return bd;
}
bd_mutex_init(&bd->mutex);
#ifdef USING_BDJAVA
bd_mutex_init(&bd->argb_buffer_mutex);
#endif
_fill_disc_info(bd, &enc_info);
BD_DEBUG(DBG_BLURAY, "BLURAY initialized!\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment