[vlc-commits] subtitles: fix potential invalid pointer use

Steve Lhomme git at videolan.org
Fri May 20 18:19:48 CEST 2016


vlc | branch: master | Steve Lhomme <robUx4 at gmail.com> | Fri May 20 18:12:01 2016 +0200| [069213325d1ef400070a5602314e64122a8f84fa] | committer: Thomas Guillem

subtitles: fix potential invalid pointer use

Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=069213325d1ef400070a5602314e64122a8f84fa
---

 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



More information about the vlc-commits mailing list