[vlc-commits] [Git][videolan/vlc][master] 6 commits: d3d11: fix p_outpic leak in adjust filter

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Apr 18 09:07:51 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
6b38a159 by Martin Finkel at 2026-04-18T08:19:39+00:00
d3d11: fix p_outpic leak in adjust filter

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

- - - - -
5b8977e9 by Martin Finkel at 2026-04-18T08:19:39+00: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.

- - - - -
cdfbe738 by Martin Finkel at 2026-04-18T08:19:39+00:00
d3d11: fix IWbemClassObject leak in D3D11_GetSystemDriver

When pclsObj->Get(DriverVersion) failed, the code jumped to done
without releasing pclsObj. The Release at line 267 only runs on
the success path.

- - - - -
f98a8300 by Martin Finkel at 2026-04-18T08:19:39+00:00
d3d11: fix BSTR leak in D3D11_GetSystemDriver on CoInitializeEx failure

Three BSTR strings were allocated before CoInitializeEx. If it
failed, the early return bypassed SysFreeString in the done label.

- - - - -
688e35d3 by Martin Finkel at 2026-04-18T08:19:39+00:00
d3d11: fix AMF output leak in D3D11_UpscalerScale

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

- - - - -
d6b9acc2 by Martin Finkel at 2026-04-18T08:19:39+00: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.

- - - - -


4 changed files:

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


Changes:

=====================================
modules/hw/d3d11/d3d11_filters.c
=====================================
@@ -213,6 +213,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;
     }
@@ -471,6 +472,7 @@ static int D3D11OpenAdjust(filter_t *filter)
     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
=====================================
@@ -209,6 +209,11 @@ static int assert_staging(filter_t *p_filter, filter_sys_t *sys, DXGI_FORMAT for
                 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_chroma/d3d11_fmt.cpp
=====================================
@@ -179,6 +179,9 @@ static LARGE_INTEGER D3D11_GetSystemDriver(vlc_object_t *obj, d3d11_device_t *d3
     if (FAILED(hr))
     {
         msg_Dbg(obj, "Unable to initialize COM library");
+        SysFreeString(bRootNamespace);
+        SysFreeString(bWQL);
+        SysFreeString(bVideoController);
         return {};
     }
 
@@ -248,6 +251,7 @@ static LARGE_INTEGER D3D11_GetSystemDriver(vlc_object_t *obj, d3d11_device_t *d3
     if ( FAILED( hr ) )
     {
         msg_Warn(obj, "failed to read the driver version");
+        pclsObj->Release();
         goto done;
     }
 


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



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/af3dc66b251d8905316e666c9f8801a3ef25c79a...d6b9acc2afa0797345ed285bfd708a3e58858a4d

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




More information about the vlc-commits mailing list