diff --git a/doc/Changelog.html b/doc/Changelog.html
index 95092b86..9123b881 100644
--- a/doc/Changelog.html
+++ b/doc/Changelog.html
@@ -88,7 +88,8 @@ h='gmail.com';a='@';n='z
document.write(''+e+'<\/'+'a'+'>');
// -->
-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]
diff --git a/doc/Changelog.md b/doc/Changelog.md
index f58a7b73..17a35b1b 100644
--- a/doc/Changelog.md
+++ b/doc/Changelog.md
@@ -6,6 +6,7 @@
* Added Hungarian translation, thanks to Zityi's Translator Team
* 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] ## {-}
diff --git a/src/Config.h b/src/Config.h
index d3bceacb..8c115d3d 100644
--- a/src/Config.h
+++ b/src/Config.h
@@ -35,7 +35,7 @@
#define VER_LAMEXP_MINOR_LO 2
#define VER_LAMEXP_TYPE Alpha
#define VER_LAMEXP_PATCH 1
-#define VER_LAMEXP_BUILD 1706
+#define VER_LAMEXP_BUILD 1708
#define VER_LAMEXP_CONFG 1700
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/Dialog_CueImport.cpp b/src/Dialog_CueImport.cpp
index 70d7549d..81d66947 100644
--- a/src/Dialog_CueImport.cpp
+++ b/src/Dialog_CueImport.cpp
@@ -248,14 +248,19 @@ void CueImportDialog::modelChanged(void)
void CueImportDialog::browseButtonClicked(void)
{
- QString newOutDir, currentDir = m_outputDir;
-
- while(QDir(currentDir).exists())
+ QString currentDir = QDir::fromNativeSeparators(m_outputDir);
+ while(!QDir(currentDir).exists())
{
- int pos = qMax(currentDir.lastIndexOf(QChar('\\')), currentDir.lastIndexOf(QChar('/')));
- if(pos > 0) currentDir.left(pos - 1); else break;
+ const int pos = currentDir.lastIndexOf(QChar('/'));
+ if(pos > 2)
+ {
+ currentDir = currentDir.left(pos);
+ continue;
+ }
+ break;
}
+ QString newOutDir;
if(MUtils::GUI::themes_enabled())
{
newOutDir = QFileDialog::getExistingDirectory(this, tr("Choose Output Directory"), currentDir);