Commit Graph
28 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 c5ef99ad3f IconCache: Check entry lengths before allocating when loading the cache
The key was resized before its length was checked, and the data length
wasn't checked at all, so a corrupt icon.cache could make a multi-GB
allocation and crash every launch. The cache is only saved at a clean
exit, so a bad file stayed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 10:26:00 -06:00
Henrik RydgårdandClaude Opus 5.5 6b45c4f3e2 IconCache: Drop icons that fail to decode instead of keeping them forever
Any 200 response went into the cache, and one that didn't decode (a
captive portal's HTML, or a PNG over the 256x128 limit) was marked bad,
saved to icon.cache and never downloaded again. Remove it and mark it
failed, so MarkPending allows another download after the retry delay.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 10:26:00 -06:00
Henrik RydgårdandClaude Opus 5.5 00208d3d80 Achievements: Enable HTTPS on UWP, retry failed icon downloads
UWP compiled naett with the WinHTTP backend but never reported
SYSPROP_SUPPORTS_HTTPS, so achievement traffic and badge icons went over
plain http. When the media server redirected to https, icons failed.

A failed icon download also left the URL marked pending, so it was never
retried for the rest of the session. Mark it failed instead, and let
IconCache retry it after 30 seconds.

The set-completed badge also skipped RemoveHttpsIfNeeded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-01 10:26:00 -06:00
Henrik Rydgård a7b1b319ce Limit PNG decode dimensions to prevent decompression bombs
pngLoadPtr allocated the decoded buffer directly from attacker-controlled
PNG IHDR dimensions with no upper bound, so browsing a crafted game icon
or savedata could trigger a multi-gigabyte allocation.

- Add maxWidth/maxHeight parameters to pngLoadPtr (default 8192x8192)
  and reject images larger than the limits.
- Thread the limits through LoadTextureLevelsFromFileData,
  CreateTextureFromFileData, and CreateTextureFromFile.
- Limit game icons to 256x128 in GameInfoCache and IconCache.
2026-08-01 11:41:24 +02:00
Henrik Rydgård f163d1ecbc Merge pull request #21738 from hrydgard/assorted-fixes
Code cleanup from GermanAizek, fix hidden ShowMenuBar option
2026-05-27 12:51:34 +02:00
Herman Semenoff b1d140e8e7 OpenGL/Vulkan/UI: duplicate fields move to separate const reference var 2026-05-27 12:26:12 +02:00
Herman Semenoff 400d136f51 GPU: modernize use C++17 constexpr for precalculate compilation 2026-05-19 21:57:45 +03:00
Henrik Rydgård 419ab46172 Avoid needing std::string as cache keys in IconCache 2026-01-20 14:09:16 +01:00
刘皓 5716cbd41d Use the libretro VFS interface in libretro builds 2026-01-01 00:24:01 -05:00
Henrik Rydgård 9ce9e43481 Make some uses of the erase-iter idiom safer and more consistent 2025-02-04 10:31:17 -06:00
Henrik Rydgård 3e198c53b2 More include cleanup 2024-12-18 13:57:26 +01:00
Henrik Rydgård 4d6905672e Bunch more linting 2024-10-10 11:57:10 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Herman Semenov 4ea842a3c1 Minor replaced insert to emplace C++11 2023-12-19 16:06:48 +03:00
Herman Semenov b8748ae9e5 [Common/File/GPU/Render/Input] Using reserve if possible 2023-12-15 14:00:51 +03:00
Henrik Rydgård f1bc547e94 IconCache: Make valgrind happy (zero some struct padding bytes before writing to disk) 2023-10-12 10:51:14 +02:00
Henrik Rydgård 2648cd0eee Store: Fix race condition causing crashes if looking at another game before an icon finishes downloading 2023-09-20 21:49:17 +02:00
Henrik Rydgård d15001b5d3 Check the return value of fread to avoid warning 2023-09-15 11:21:07 +02:00
Henrik Rydgård c343c194ff Early-outs in IconCache 2023-09-11 00:31:41 +02:00
Henrik Rydgård ab6e902fea Make naett work on Android, UWP, Mac. Exclude on Linux 2023-07-21 10:28:31 +02:00
Henrik Rydgård 66e54dee11 Minor iconcache update 2023-07-13 16:47:06 +02:00
Henrik Rydgård 86ee2253ee Save/Load the icon cache to disk if RetroAchievements are enabled.
Should reduce the server load a bit.
2023-07-13 12:44:20 +02:00
Henrik Rydgård 300a64a86d IconCache: Remove texture objects quite quickly after it stops getting used.
They can be recreated pretty quickly as needed.
2023-06-18 15:24:56 +02:00
Henrik Rydgård 6f9941dafa Crashfix during clearing 2023-06-18 15:14:42 +02:00
Henrik Rydgård 2bf2f745e2 IconCache: Add pending state to avoid duplicate downloads in some cases 2023-06-18 14:54:11 +02:00
Henrik Rydgård cb5926761b Add a way to monitor the icon cache from the system info screen. 2023-06-18 14:18:45 +02:00
Henrik Rydgård 2bee5b64e4 Add new icon cache, for caching small images.
It doesn't try to insert or fetch missing things itself, re-fetching is up to the caller.

This will be required for handling the many achievement icons.

Saving/loading the cache to a single file on disk is implemented but not
hooked up yet. It works without it, though of course will have to
re-fetch things on the next startup.
2023-06-18 14:11:12 +02:00
Henrik Rydgård 9f88dbd656 Icon cache for UI rendering
This will be needed for achievements, and has uses already now.
2023-06-18 14:11:12 +02:00