Commit df045e5b authored by Steve Lhomme's avatar Steve Lhomme Committed by Hugo Beauzée-Luyssen

hw:d3d11: Fix crashes when mixing D3D11 filters with CPU filters

The filter chain is not recomputed and we may use pictures not coming from the
right pool.

Fix crash in #19266
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit c6ca3727)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 1bb4368a
......@@ -146,17 +146,17 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
if( p_cur && p_next )
{
picture_sys_t *picsys_next = ActivePictureSys(p_next);
if ( assert_ProcessorInput(p_filter, picsys_next) )
if ( unlikely(!picsys_next) || assert_ProcessorInput(p_filter, picsys_next) )
return VLC_EGENERIC;
picture_sys_t *picsys_cur = ActivePictureSys(p_cur);
if ( assert_ProcessorInput(p_filter, picsys_cur) )
if ( unlikely(!picsys_cur) || assert_ProcessorInput(p_filter, picsys_cur) )
return VLC_EGENERIC;
if ( p_prev )
{
picture_sys_t *picsys_prev = ActivePictureSys(p_prev);
if ( assert_ProcessorInput(p_filter, picsys_prev) )
if ( unlikely(!picsys_prev) || assert_ProcessorInput(p_filter, picsys_prev) )
return VLC_EGENERIC;
stream.pInputSurface = picsys_cur->processorInput;
......@@ -177,7 +177,7 @@ static int RenderPic( filter_t *p_filter, picture_t *p_outpic, picture_t *p_pic,
else
{
picture_sys_t *p_sys_src = ActivePictureSys(p_pic);
if ( assert_ProcessorInput(p_filter, p_sys_src) )
if ( unlikely(!p_sys_src) || assert_ProcessorInput(p_filter, p_sys_src) )
return VLC_EGENERIC;
/* first single frame */
......
......@@ -225,6 +225,13 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic)
picture_Release( p_pic );
return NULL;
}
if (unlikely(!p_outpic->p_sys))
{
/* the output filter configuration may have changed since the filter
* was opened */
picture_Release( p_pic );
return NULL;
}
picture_CopyProperties( p_outpic, p_pic );
......
......@@ -580,6 +580,12 @@ static void NV12_D3D11(filter_t *p_filter, picture_t *src, picture_t *dst)
{
filter_sys_t *sys = (filter_sys_t*) p_filter->p_sys;
picture_sys_t *p_sys = dst->p_sys;
if (unlikely(p_sys==NULL))
{
/* the output filter configuration may have changed since the filter
* was opened */
return;
}
D3D11_TEXTURE2D_DESC texDesc;
ID3D11Texture2D_GetDesc( sys->staging_pic->p_sys->texture[KNOWN_DXGI_INDEX], &texDesc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment