[vlc-commits] input/subtitles: fix NULL dereference

Thomas Guillem git at videolan.org
Tue Jun 21 11:12:47 CEST 2016


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jun 21 11:11:32 2016 +0200| [467d1f512e3a32e29b256d8d9a13485229bdfe74] | committer: Thomas Guillem

input/subtitles: fix NULL dereference

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

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

diff --git a/src/input/subtitles.c b/src/input/subtitles.c
index 34eede4..60358f6 100644
--- a/src/input/subtitles.c
+++ b/src/input/subtitles.c
@@ -388,6 +388,10 @@ int subtitles_Detect( input_thread_t *p_this, char *psz_path, const char *psz_na
             {
                 input_item_slave_t *p_sub_inner = pp_slaves[j];
 
+                /* A slave can be null if it's already rejected */
+                if( p_sub_inner == NULL )
+                    continue;
+
                 /* check that the filenames without extension match */
                 if( strncasecmp( p_sub->psz_uri, p_sub_inner->psz_uri,
                     strlen( p_sub->psz_uri ) - 3 ) )



More information about the vlc-commits mailing list