From 30ea472c517394db80163be652ce8b0e7c8b422c Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 4 Feb 2012 16:51:14 +0000 Subject: [PATCH] !SetWallpaper: Added file check. --- Library/System.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/System.cpp b/Library/System.cpp index 023fcfea..928811b4 100644 --- a/Library/System.cpp +++ b/Library/System.cpp @@ -1239,6 +1239,12 @@ void CSystem::SetWallpaper(const std::wstring& wallpaper, const std::wstring& st if (!wallpaper.empty()) { + if (_waccess(wallpaper.c_str(), 0) == -1) + { + LogWithArgs(LOG_ERROR, L"!SetWallpaper: Unable to read file: %s", wallpaper.c_str()); + return; + } + if (GetOSPlatform() < OSPLATFORM_7) { // Gotta convert to .bmp for pre-7