Fix crash in Qt GUI for movie player file path parser.

This commit is contained in:
harry 2023-01-21 11:59:56 -05:00
parent 821e82a069
commit 26f623f5ea
2 changed files with 9 additions and 4 deletions

View File

@ -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;

View File

@ -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);