From 4b937a24920a0ab7cab921e28366ea2e37c446b5 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 2 Aug 2016 08:28:08 +0200 Subject: [PATCH] d3d11va: only copy the usable area The output texture may be smaller than the input. Not knowing if there's any check in D3D11 it's better to be safe than sorry. --- modules/codec/avcodec/d3d11va.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c index bf40ad6247..7f75b93f97 100644 --- a/modules/codec/avcodec/d3d11va.c +++ b/modules/codec/avcodec/d3d11va.c @@ -312,11 +312,14 @@ static int Extract(vlc_va_t *va, picture_t *output, uint8_t *data) ID3D11VideoDecoderOutputView_GetDesc( src, &viewDesc ); /* copy decoder slice to surface */ + D3D11_BOX copyBox = { + .right = dstDesc.Width, .bottom = dstDesc.Height, .back = 1, + }; ID3D11DeviceContext_CopySubresourceRegion(sys->d3dctx, (ID3D11Resource*) p_sys_out->texture, 0, 0, 0, 0, (ID3D11Resource*) p_sys_in->texture, viewDesc.Texture2D.ArraySlice, - NULL); + ©Box); } } break; -- 2.11.4.GIT