diff --git a/src/hyprpicker.cpp b/src/hyprpicker.cpp index b694f1d..aaee7e1 100644 --- a/src/hyprpicker.cpp +++ b/src/hyprpicker.cpp @@ -459,7 +459,7 @@ void CHyprpicker::renderSurface(CLayerSurface* pSurface, bool forceInactive) { CColor CHyprpicker::getColorFromPixel(CLayerSurface* pLS, Vector2D pix) { pix = pix.floor(); - if (pix.x >= pLS->screenBuffer->pixelSize.x || pix.y >= pLS->screenBuffer->pixelSize.y) + if (pix.x >= pLS->screenBuffer->pixelSize.x || pix.y >= pLS->screenBuffer->pixelSize.y || pix.x < 0 || pix.y < 0) return CColor{0, 0, 0, 0}; void* dataSrc = pLS->screenBuffer->paddedData ? pLS->screenBuffer->paddedData : pLS->screenBuffer->data;