[vlc-commits] [Git][videolan/vlc][3.0.x] 4 commits: d3d11: fix p_outpic leak in adjust filter

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Tue Apr 21 12:56:28 UTC 2026



Felix Paul Kühne pushed to branch 3.0.x at VideoLAN / VLC


Commits:
fbd60e53 by Martin Finkel at 2026-04-21T13:30:01+02:00
d3d11: fix p_outpic leak in adjust filter

When ActiveD3D11PictureSys returned NULL, p_pic was released
but p_outpic was not.

(cherry picked from commit 6b38a1592d40d41568f6cd3c0d0971c5df4a953f)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
4b60faa2 by Martin Finkel at 2026-04-21T13:30:01+02:00
d3d11: fix double-release of texture in D3D11OpenAdjust

When CreateTexture2D for out[1] failed, out[0].texture was released
but not NULLed. The error label then released it again via the
stale pointer.

(cherry picked from commit 5b8977e9e36a29b5fddbe7738a7b9a5989d808be) (rebased)
rebased:
- in VLC 3 sys->d3d_dev is not a pointer
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
601f7206 by Martin Finkel at 2026-04-21T13:30:01+02:00
d3d11: fix AMF output leak in D3D11_UpscalerScale

When D3D11_AllocateResourceView failed, amfOutput was not released
before the early return.

(cherry picked from commit 688e35d359a7928f06da55dc053a60c841c42dd6) (rebased)
rebased:
- VLC_ENOTSUP doesn't exist in VLC 3
- D3D11_AllocateResourceView() is called D3D11_AllocateShaderView() in VLC 3
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -
ce2d8c53 by Martin Finkel at 2026-04-21T13:30:01+02:00
d3d11: fix procOutTexture leak in assert_staging

When CreateTexture2D for procOutTexture succeeded but can_map
failed, the else block released staging but not procOutTexture.

(cherry picked from commit d6b9acc2afa0797345ed285bfd708a3e58858a4d)
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>

- - - - -


3 changed files:

- modules/hw/d3d11/d3d11_filters.c
- modules/hw/d3d11/d3d11_surface.c
- modules/video_output/win32/d3d11_scaler.cpp


Changes:

=====================================
modules/hw/d3d11/d3d11_filters.c
=====================================
@@ -243,6 +243,7 @@ static picture_t *Filter(filter_t *p_filter, picture_t *p_pic)
     {
         /* the output filter configuration may have changed since the filter
          * was opened */
+        picture_Release( p_outpic );
         picture_Release( p_pic );
         return NULL;
     }
@@ -532,6 +533,7 @@ static int D3D11OpenAdjust(vlc_object_t *obj)
     hr = ID3D11Device_CreateTexture2D( sys->d3d_dev.d3ddevice, &texDesc, NULL, &sys->out[1].texture );
     if (FAILED(hr)) {
         ID3D11Texture2D_Release(sys->out[0].texture);
+        sys->out[0].texture = NULL;
         msg_Err(filter, "CreateTexture2D failed. (hr=0x%lX)", hr);
         goto error;
     }


=====================================
modules/hw/d3d11/d3d11_surface.c
=====================================
@@ -255,6 +255,11 @@ static int assert_staging(filter_t *p_filter, picture_sys_t *p_sys)
                 else
                 {
                     msg_Dbg(p_filter, "can't create intermediate texture (hr=0x%lX)", hr);
+                    if (sys->procOutTexture)
+                    {
+                        ID3D11Texture2D_Release(sys->procOutTexture);
+                        sys->procOutTexture = NULL;
+                    }
                     ID3D11Texture2D_Release(sys->staging);
                     sys->staging = NULL;
                 }


=====================================
modules/video_output/win32/d3d11_scaler.cpp
=====================================
@@ -727,6 +727,7 @@ int D3D11_UpscalerScale(vlc_object_t *vd, d3d11_scaler *scaleProc, picture_sys_t
         if (D3D11_AllocateShaderView(vd, scaleProc->d3d_dev->d3ddevice, scaleProc->d3d_fmt,
                                     _upscaled, 0, scaleProc->SRVs) != VLC_SUCCESS)
         {
+            amfOutput->Release();
             return (-ENOTSUP);
         }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9d946bb238d89299ee11a94059ebc6254efa3983...ce2d8c533c6890a1d3bfd2170dda38dc20acf02b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9d946bb238d89299ee11a94059ebc6254efa3983...ce2d8c533c6890a1d3bfd2170dda38dc20acf02b
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list