vlc | branch: master | Steve Lhomme <[email protected]> | Fri Jun 26 12:25:18 2020 +0200| [cf3eee8f9a13a9f126a0ae8501067b856cb90e15] | committer: Steve Lhomme
d3d11: fix double resource allocation The D3D11_AllocateResourceView() is already done in D3D11_AllocPicture(). Fixes a leak when D3D11 filters are used. > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cf3eee8f9a13a9f126a0ae8501067b856cb90e15 --- modules/hw/d3d11/d3d11_deinterlace.c | 9 +-------- modules/hw/d3d11/d3d11_filters.c | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/modules/hw/d3d11/d3d11_deinterlace.c b/modules/hw/d3d11/d3d11_deinterlace.c index 3ad3224daa..fa1684d5ed 100644 --- a/modules/hw/d3d11/d3d11_deinterlace.c +++ b/modules/hw/d3d11/d3d11_deinterlace.c @@ -226,14 +226,7 @@ picture_t *AllocPicture( filter_t *p_filter ) if (unlikely(cfg == NULL)) return NULL; - picture_t *pic = D3D11_AllocPicture(VLC_OBJECT(p_filter), &p_filter->fmt_out.video, p_filter->vctx_out, cfg); - if (unlikely(pic == NULL)) - return NULL; - - struct d3d11_pic_context *pic_ctx = container_of(pic->context, struct d3d11_pic_context, s); - D3D11_AllocateResourceView(p_filter, p_sys->d3d_dev->d3ddevice, cfg, pic_ctx->picsys.texture, 0, pic_ctx->picsys.renderSrc); - - return pic; + return D3D11_AllocPicture(VLC_OBJECT(p_filter), &p_filter->fmt_out.video, p_filter->vctx_out, cfg); } int D3D11OpenDeinterlace(vlc_object_t *obj) diff --git a/modules/hw/d3d11/d3d11_filters.c b/modules/hw/d3d11/d3d11_filters.c index c38dcb2316..64325e4508 100644 --- a/modules/hw/d3d11/d3d11_filters.c +++ b/modules/hw/d3d11/d3d11_filters.c @@ -209,14 +209,7 @@ static picture_t *AllocPicture( filter_t *p_filter ) if (unlikely(cfg == NULL)) return NULL; - picture_t *pic = D3D11_AllocPicture(VLC_OBJECT(p_filter), &p_filter->fmt_out.video, p_filter->vctx_out, cfg); - if (unlikely(pic == NULL)) - return NULL; - - struct d3d11_pic_context *pic_ctx = container_of(pic->context, struct d3d11_pic_context, s); - D3D11_AllocateResourceView(p_filter, p_sys->d3d_dev->d3ddevice, cfg, pic_ctx->picsys.texture, 0, pic_ctx->picsys.renderSrc); - - return pic; + return D3D11_AllocPicture(VLC_OBJECT(p_filter), &p_filter->fmt_out.video, p_filter->vctx_out, cfg); } static picture_t *Filter(filter_t *p_filter, picture_t *p_pic) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
