1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 04:58:06 +00:00

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:
Hui Jin 2019-07-26 13:28:00 +08:00 committed by James Ross-Gowan
parent 191737b9c9
commit fda45f4537

View File

@ -161,6 +161,7 @@ static void d3d11_uninit(struct ra_ctx *ctx)
{
struct priv *p = ctx->priv;
if (ctx->ra)
ra_tex_free(ctx->ra, &p->backbuffer);
SAFE_RELEASE(p->swapchain);
vo_w32_uninit(ctx->vo);
@ -168,6 +169,7 @@ static void d3d11_uninit(struct ra_ctx *ctx)
// Destory the RA last to prevent objects we hold from showing up in D3D's
// leak checker
if (ctx->ra)
ctx->ra->fns->destroy(ctx->ra);
}