[vlc-commits] [Git][videolan/vlc][master] direct3d9: fix filepath leak

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Oct 4 08:44:53 UTC 2025



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
9d2d8f01 by Johannes Kauffmann at 2025-10-04T08:29:24+00:00
direct3d9: fix filepath leak

In case the string is non-NULL but empty, var_InheritString returns NULL
so we can treat that case the same.

- - - - -


1 changed file:

- modules/video_output/win32/direct3d9.c


Changes:

=====================================
modules/video_output/win32/direct3d9.c
=====================================
@@ -753,13 +753,11 @@ static int Direct3D9CreateShaders(vout_display_t *vd)
             goto error; /* Unrecognized entry in the list. */
         /* The source code of the shader needs to be read from a file. */
         char *filepath = var_InheritString(vd, "direct3d9-shader-file");
-        if (!filepath || !*filepath)
-        {
-            free(filepath);
+        if (!filepath)
             goto error;
-        }
         /* Open file, find its size with fseek/ftell and read its content in a buffer. */
         fs = vlc_fopen(filepath, "rb");
+        free(filepath);
         if (!fs)
             goto error;
         int ret = fseek(fs, 0, SEEK_END);



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/9d2d8f0136730fb81d1de130680796f6f512aad3

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


VideoLAN code repository instance


More information about the vlc-commits mailing list