summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authornikitax44 <49244351+nikitax44@users.noreply.github.com>2026-03-19 16:17:56 +0300
committerGitHub <noreply@github.com>2026-03-19 13:17:56 +0000
commitad46ff635bcf7b4877b03e97d8e85468f025f4a1 (patch)
tree9ce83772e6c416d61e645e7efc52d2351637167c /src/render/OpenGL.cpp
parentd635b499e1b2b9cf54b780ca7aee2b97cadeee89 (diff)
renderer: fix crash when shader path isn't a file (#13756)
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 94d78b0b..c2c19993 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -889,10 +889,21 @@ void CHyprOpenGLImpl::applyScreenShader(const std::string& path) {
if (path.empty() || path == STRVAL_EMPTY)
return;
- std::ifstream infile(absolutePath(path, g_pConfigManager->getMainConfigPath()));
+ std::string absPath = absolutePath(path, g_pConfigManager->getMainConfigPath());
+
+ std::error_code ec;
+ if (!std::filesystem::is_regular_file(absPath, ec)) {
+ if (ec)
+ g_pConfigManager->addParseError("Screen shader parser: Failed to check screen shader path: " + ec.message());
+ else
+ g_pConfigManager->addParseError("Screen shader parser: Screen shader path is not a regular file");
+ return;
+ }
+
+ std::ifstream infile(absPath);
if (!infile.good()) {
- g_pConfigManager->addParseError("Screen shader parser: Screen shader path not found");
+ g_pConfigManager->addParseError("Screen shader parser: Failed to open screen shader");
return;
}