[vlc-devel] [PATCH] subtitles: fix potential invalid pointer use

Steve Lhomme robux4 at videolabs.io
Fri May 20 18:12:01 CEST 2016


From: Steve Lhomme <robUx4 at gmail.com>

---
 src/input/subtitles.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/input/subtitles.c b/src/input/subtitles.c
index 906087e..cda172e 100644
--- a/src/input/subtitles.c
+++ b/src/input/subtitles.c
@@ -312,6 +312,8 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
 
                 size_t i_len = strlen( psz_dir );
                 const char *psz_format;
+                if ( i_len == 0 )
+                    continue;
                 if( psz_dir[i_len - 1] == DIR_SEP_CHAR )
                     psz_format = "%s%s";
                 else
-- 
2.8.1



More information about the vlc-devel mailing list