[vlc-commits] [Git][videolan/vlc][3.0.x] direct3d9: fix filepath leak

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Thu Oct 9 16:56:41 UTC 2025



Rémi Denis-Courmont pushed to branch 3.0.x at VideoLAN / VLC


Commits:
b69ca0fa by Johannes Kauffmann at 2025-10-05T12:17:56+02: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.

(cherry picked from commit 9d2d8f0136730fb81d1de130680796f6f512aad3)
edited:
- the direct3d9 code is reordered on master

- - - - -


1 changed file:

- modules/video_output/win32/direct3d9.c


Changes:

=====================================
modules/video_output/win32/direct3d9.c
=====================================
@@ -1355,13 +1355,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 = 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/b69ca0fa1a5ec0703f8a8514a471d71ed5aca058

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/b69ca0fa1a5ec0703f8a8514a471d71ed5aca058
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