mirror of https://github.com/mpv-player/mpv
vo_d3d11/context: fix crash due to ctx->ra is null pointer access
'ctx->ra' is null pointer when d3d11 init failed before call 'ra_d3d11_create' in 'd3d11_init'.
This commit is contained in:
parent
191737b9c9
commit
fda45f4537
|
@ -161,14 +161,16 @@ static void d3d11_uninit(struct ra_ctx *ctx)
|
|||
{
|
||||
struct priv *p = ctx->priv;
|
||||
|
||||
ra_tex_free(ctx->ra, &p->backbuffer);
|
||||
if (ctx->ra)
|
||||
ra_tex_free(ctx->ra, &p->backbuffer);
|
||||
SAFE_RELEASE(p->swapchain);
|
||||
vo_w32_uninit(ctx->vo);
|
||||
SAFE_RELEASE(p->device);
|
||||
|
||||
// Destory the RA last to prevent objects we hold from showing up in D3D's
|
||||
// leak checker
|
||||
ctx->ra->fns->destroy(ctx->ra);
|
||||
if (ctx->ra)
|
||||
ctx->ra->fns->destroy(ctx->ra);
|
||||
}
|
||||
|
||||
static const struct ra_swapchain_fns d3d11_swapchain = {
|
||||
|
|
Loading…
Reference in New Issue