From 26f623f5ea348f38295666dd4312e5b3e9322c9b Mon Sep 17 00:00:00 2001 From: harry Date: Sat, 21 Jan 2023 11:59:56 -0500 Subject: [PATCH] Fix crash in Qt GUI for movie player file path parser. --- src/drivers/Qt/ConsoleUtilities.cpp | 11 +++++++---- src/drivers/Qt/MoviePlay.cpp | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/drivers/Qt/ConsoleUtilities.cpp b/src/drivers/Qt/ConsoleUtilities.cpp index 196b8081..fac6d5ec 100644 --- a/src/drivers/Qt/ConsoleUtilities.cpp +++ b/src/drivers/Qt/ConsoleUtilities.cpp @@ -222,11 +222,14 @@ int parseFilepath( const char *filepath, std::string *dir, std::string *base, st { suffix->assign( &filepath[j] ); } - i = base->find_last_of('.'); - - if ( i != std::string::npos ) + if (base) { - base->erase(i); + i = base->find_last_of('.'); + + if ( i != std::string::npos ) + { + base->erase(i); + } } } return 0; diff --git a/src/drivers/Qt/MoviePlay.cpp b/src/drivers/Qt/MoviePlay.cpp index 8bf60f79..5f4ac335 100644 --- a/src/drivers/Qt/MoviePlay.cpp +++ b/src/drivers/Qt/MoviePlay.cpp @@ -65,6 +65,8 @@ MoviePlayDialog_t::MoviePlayDialog_t(QWidget *parent) movSelBox = new QComboBox(); movBrowseBtn = new QPushButton(tr("Browse")); + movSelBox->setMaximumWidth(512); + hbox->addWidget(lbl, 1); hbox->addWidget(movSelBox, 100); hbox->addWidget(movBrowseBtn, 1);