From 740108c37c84f22ae2cca1c8145d85a12b2de2b0 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 11 Aug 2022 01:13:49 +0600 Subject: [PATCH 1/2] cdrom: Properly empty the path of image if it can't be loaded --- src/cdrom/cdrom_image.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cdrom/cdrom_image.c b/src/cdrom/cdrom_image.c index 9a653b310..f8f7536e6 100644 --- a/src/cdrom/cdrom_image.c +++ b/src/cdrom/cdrom_image.c @@ -257,6 +257,7 @@ image_open_abort(cdrom_t *dev) cdrom_image_close(dev); dev->ops = NULL; dev->host_drive = 0; + dev->image_path[0] = 0; return 1; } From 97242168ded8a5f1fbd289512056961952784d15 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Thu, 11 Aug 2022 01:16:56 +0600 Subject: [PATCH 2/2] qt: Fix usage of unconverted path in plat_fopen64 UTF-8 paths are not supported on all Windows installations, only some of them. This was only accounted for in the 32-bit plat_fopen function, not on 64-bit plat_fopen64. Fix that oversight. --- src/qt/qt_platform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/qt_platform.cpp b/src/qt/qt_platform.cpp index 8aa85fb9c..8a41769a9 100644 --- a/src/qt/qt_platform.cpp +++ b/src/qt/qt_platform.cpp @@ -167,7 +167,7 @@ plat_fopen(const char *path, const char *mode) FILE * plat_fopen64(const char *path, const char *mode) { - return fopen(path, mode); + return fopen(QString::fromUtf8(path).toLocal8Bit(), mode); } int