Fixed potential deadlock (infinite loop) in Cue Sheet import dialog when "Browse..." button is clicked.

This commit is contained in:
LoRd_MuldeR 2015-04-23 23:41:36 +02:00
parent 7f1d9c3b91
commit 3deacf11df
4 changed files with 14 additions and 7 deletions

View File

@ -88,7 +88,8 @@ h='gmail.com';a='@';n='z&#x
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>'); document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
// --> // -->
</script><noscript>&#122;&#x69;&#116;&#x79;&#x69;&#x73;&#x6f;&#102;&#116;&#32;&#x61;&#116;&#32;&#x67;&#x6d;&#x61;&#x69;&#108;&#32;&#100;&#x6f;&#116;&#32;&#x63;&#x6f;&#x6d;</noscript><br /></li> </script><noscript>&#122;&#x69;&#116;&#x79;&#x69;&#x73;&#x6f;&#102;&#116;&#32;&#x61;&#116;&#32;&#x67;&#x6d;&#x61;&#x69;&#108;&#32;&#100;&#x6f;&#116;&#32;&#x63;&#x6f;&#x6d;</noscript><br /></li>
<li>Updated ALAC decoder to refalac v1.47 (2015-02-15), based on reference implementation by Apple</li> <li>Updated ALAC decoder to refalac v1.47 (2015-02-15), based on reference implementation by Apple<br /></li>
<li>Fixed potential deadlock in Cue Sheet import dialog when &quot;Browse...&quot; button is clicked</li>
</ul> </ul>
<h2 id="lamexp-v4.11-2015-04-05" class="unnumbered">LameXP v4.11 [2015-04-05]</h2> <h2 id="lamexp-v4.11-2015-04-05" class="unnumbered">LameXP v4.11 [2015-04-05]</h2>
<ul> <ul>

View File

@ -6,6 +6,7 @@
* Added Hungarian translation, thanks to Zityi's Translator Team <zityisoft@gmail.com> * Added Hungarian translation, thanks to Zityi's Translator Team <zityisoft@gmail.com>
* Updated ALAC decoder to refalac v1.47 (2015-02-15), based on reference implementation by Apple * Updated ALAC decoder to refalac v1.47 (2015-02-15), based on reference implementation by Apple
* Fixed potential deadlock in Cue Sheet import dialog when "Browse..." button is clicked
## LameXP v4.11 [2015-04-05] ## {-} ## LameXP v4.11 [2015-04-05] ## {-}

View File

@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 2 #define VER_LAMEXP_MINOR_LO 2
#define VER_LAMEXP_TYPE Alpha #define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 1 #define VER_LAMEXP_PATCH 1
#define VER_LAMEXP_BUILD 1706 #define VER_LAMEXP_BUILD 1708
#define VER_LAMEXP_CONFG 1700 #define VER_LAMEXP_CONFG 1700
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////

View File

@ -248,14 +248,19 @@ void CueImportDialog::modelChanged(void)
void CueImportDialog::browseButtonClicked(void) void CueImportDialog::browseButtonClicked(void)
{ {
QString newOutDir, currentDir = m_outputDir; QString currentDir = QDir::fromNativeSeparators(m_outputDir);
while(!QDir(currentDir).exists())
while(QDir(currentDir).exists())
{ {
int pos = qMax(currentDir.lastIndexOf(QChar('\\')), currentDir.lastIndexOf(QChar('/'))); const int pos = currentDir.lastIndexOf(QChar('/'));
if(pos > 0) currentDir.left(pos - 1); else break; if(pos > 2)
{
currentDir = currentDir.left(pos);
continue;
}
break;
} }
QString newOutDir;
if(MUtils::GUI::themes_enabled()) if(MUtils::GUI::themes_enabled())
{ {
newOutDir = QFileDialog::getExistingDirectory(this, tr("Choose Output Directory"), currentDir); newOutDir = QFileDialog::getExistingDirectory(this, tr("Choose Output Directory"), currentDir);