[vlc-commits] d3d11va: fix crash when the video context is created but the va pool fails
Steve Lhomme
git at videolan.org
Fri Dec 13 17:28:11 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Dec 13 15:58:36 2019 +0100| [7f197d5ee70b8fafae109fd43cc6132889058fcf] | committer: Steve Lhomme
d3d11va: fix crash when the video context is created but the va pool fails
The video context will be released but it private data are not set yet.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7f197d5ee70b8fafae109fd43cc6132889058fcf
---
modules/codec/avcodec/d3d11va.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index f90e163c82..f0436aeb99 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -297,15 +297,6 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
if (sys->d3d_dev.context_mutex == INVALID_HANDLE_VALUE)
msg_Warn(va, "No mutex found to lock the decoder");
- sys->vctx = vlc_video_context_Create( dec_device, VLC_VIDEO_CONTEXT_D3D11VA,
- sizeof(d3d11_video_context_t), &d3d11_vctx_ops );
- if (sys->vctx == NULL)
- {
- msg_Dbg(va, "no video context");
- err = VLC_EGENERIC;
- goto error;
- }
-
void *d3dvidctx = NULL;
hr = ID3D11DeviceContext_QueryInterface(sys->d3d_dev.d3dcontext, &IID_ID3D11VideoContext, &d3dvidctx);
if (FAILED(hr)) {
@@ -356,6 +347,15 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, const AVPixFmtDescriptor *des
IDXGIAdapter_Release(p_adapter);
}
+ sys->vctx = vlc_video_context_Create( dec_device, VLC_VIDEO_CONTEXT_D3D11VA,
+ sizeof(d3d11_video_context_t), &d3d11_vctx_ops );
+ if (sys->vctx == NULL)
+ {
+ msg_Dbg(va, "no video context");
+ err = VLC_EGENERIC;
+ goto error;
+ }
+
d3d11_video_context_t *priv = GetD3D11ContextPrivate(sys->vctx);
priv->format = sys->render;
priv->device = sys->d3d_dev.d3dcontext;
More information about the vlc-commits
mailing list