diff options
| author | Franz <f.pitschmann@icloud.com> | 2026-11-02 17:46:22 +0100 |
|---|---|---|
| committer | Franz <f.pitschmann@icloud.com> | 2026-11-02 17:46:22 +0100 |
| commit | e64268269f4f91e47087fc86de4d34ec84970992 (patch) | |
| tree | 01edad32e20c619dece472a2cc037a47f25eb7d5 /src/tests/core/program_metadata.cpp | |
| parent | ce1b1de6f1beed36958368f89cda466937ff9716 (diff) | |
Prevents crashes when creating game shortcuts by validating the loader before accessing game titles or icons. Adds safe fallbacks for missing titles and icons, allowing shortcuts to be created even when the game loader or icon is unavailable.
Fixes a potential crash when creating game shortcuts, as reported in Issue #274.
Previously, the shortcut creation process attempted to retrieve the game title and icon even when GetLoader() returned an invalid loader. This could cause a crash when the selected game file could not be loaded correctly.
Changes
Validate the loader: Check whether the loader is valid before accessing game title or icon data.
Preserve title fallback: Continue using the title from game metadata whenever available. If no valid loader is available, fall back to the program ID.
Handle missing icons: Only attempt to retrieve the game icon when a valid loader exists. Log a warning if the icon cannot be retrieved.
Validate image data: Add a validity check in SaveIconToFile() to prevent empty or invalid images from being processed.
Expected Behavior
Game shortcuts can now be created even when no valid loader or game icon is available. In such cases, the program ID is used as the display name, and the shortcut is created without a custom game icon.
Diffstat (limited to 'src/tests/core/program_metadata.cpp')
0 files changed, 0 insertions, 0 deletions
