renderer: refuse rendering invalid resolutions

sometimes a driver fails to assign any reasonable mode in which case we might render 0x0 which will make us crash. Don't do that. Part 1 of #10678
This commit is contained in:
Vaxry
2025-06-11 16:57:07 +02:00
parent 6910ca76bd
commit f7526d6be0

View File

@@ -1165,6 +1165,11 @@ void CHyprRenderer::renderMonitor(PHLMONITOR pMonitor) {
static int damageBlinkCleanup = 0; // because double-buffered
if (pMonitor->m_pixelSize.x < 1 || pMonitor->m_pixelSize.y < 1) {
Debug::log(ERR, "Refusing to render a monitor because of an invalid pixel size: {}", pMonitor->m_pixelSize);
return;
}
if (!*PDAMAGEBLINK)
damageBlinkCleanup = 0;