mirror of https://github.com/PCSX2/pcsx2.git
GSCapture: Fix invalid substring comparison
This commit is contained in:
parent
6697e76be1
commit
14426a7b45
|
@ -1398,7 +1398,7 @@ std::optional<bool> QtHost::DownloadFile(QWidget* parent, const QString& title,
|
|||
QtModalProgressCallback progress(parent);
|
||||
progress.GetDialog().setLabelText(
|
||||
qApp->translate("EmuThread", "Downloading %1...").arg(QtUtils::StringViewToQString(
|
||||
std::string_view(url).substr((url_file_part_pos >= 0) ? (url_file_part_pos + 1) : 0))));
|
||||
std::string_view(url).substr((url_file_part_pos != std::string::npos) ? (url_file_part_pos + 1) : 0))));
|
||||
progress.GetDialog().setWindowTitle(title);
|
||||
progress.GetDialog().setWindowIcon(GetAppIcon());
|
||||
progress.SetCancellable(true);
|
||||
|
|
|
@ -25,11 +25,13 @@
|
|||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
// We're using deprecated fields because we're targeting multiple ffmpeg versions.
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable:4996) // warning C4996: 'AVCodecContext::channels': was declared deprecated
|
||||
#elif defined (__clang__)
|
||||
// We're using deprecated fields because we're targeting multiple ffmpeg versions.
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
||||
#elif defined (__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
|
@ -1359,7 +1361,7 @@ std::string GSCapture::GetNextCaptureFileName()
|
|||
// Should end with a number.
|
||||
int partnum = 2;
|
||||
std::string_view::size_type pos = name.rfind("_part");
|
||||
if (pos >= 0)
|
||||
if (pos != std::string_view::npos)
|
||||
{
|
||||
std::string_view::size_type cpos = pos + 5;
|
||||
for (; cpos < name.length(); cpos++)
|
||||
|
|
Loading…
Reference in New Issue