[vlc-commits] VLSub: Properly handle failure to extract the containing directory

Hugo Beauzée-Luyssen git at videolan.org
Wed Apr 18 16:05:36 CEST 2018


vlc/vlc-3.0 | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Apr 18 16:00:03 2018 +0200| [02860fd9787ca7696fbcac1282d47776f600e6e3] | committer: Hugo Beauzée-Luyssen

VLSub: Properly handle failure to extract the containing directory

ie. when trying to add subtitle for non local files

(cherry picked from commit b492a2b1187aaf2757050e837693540fbd211f9a)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=02860fd9787ca7696fbcac1282d47776f600e6e3
---

 share/lua/extensions/VLSub.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/share/lua/extensions/VLSub.lua b/share/lua/extensions/VLSub.lua
index a7bb4d851c..dd916aefb8 100644
--- a/share/lua/extensions/VLSub.lua
+++ b/share/lua/extensions/VLSub.lua
@@ -1509,9 +1509,12 @@ function download_subtitles()
 
   -- Determine if the path to the video file is accessible for writing
 
-  local target = openSub.file.dir..subfileName
+  local target
+  if openSub.file.dir then
+    target = openSub.file.dir..subfileName
+  end
 
-  if not file_touch(target) then
+  if not target or not file_touch(target) then
     if openSub.conf.dirPath then
       target =  openSub.conf.dirPath..slash..subfileName
       message = "<br>"..



More information about the vlc-commits mailing list