Skip to content
This repository
Browse code

fixed: don't load non-matching archived subtitles (fixes #12719)

Commit ea87f7e ("removed subtitle caching as it was only needed
on xbox, partialy takes care of #9736.") mistakenly removed the filename
check for subtitles in zip or rar archives, causing any subtitle file
inside archives to be loaded.

Fix that by re-adding a filename check into
CUtil::ScanArchiveForSubtitles().
commit f4d11b09d93df4021bfca702131dafd631df3287 1 parent 581e051
Anssi Hannula authored March 16, 2012

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  xbmc/Util.cpp
7  xbmc/Util.cpp
@@ -2459,7 +2459,12 @@ int CUtil::ScanArchiveForSubtitles( const CStdString& strArchivePath, const CStd
2459 2459
     ScanArchiveForSubtitles(strRarInRar,strMovieFileNameNoExt,vecSubtitles);
2460 2460
    }
2461 2461
    // done checking if this is a rar-in-rar
2462  
-   
  2462
+
  2463
+   // check that the found filename matches the movie filename
  2464
+   int fnl = strMovieFileNameNoExt.size();
  2465
+   if (!URIUtils::GetFileName(strPathInRar).Left(fnl).Equals(strMovieFileNameNoExt))
  2466
+     continue;
  2467
+
2463 2468
    int iPos=0;
2464 2469
     while (sub_exts[iPos])
2465 2470
     {

0 notes on commit f4d11b0

Please sign in to comment.
Something went wrong with that request. Please try again.