mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2024-12-22 06:09:48 +01:00
core: don't read negative pixel values in getColorFromPixel
This commit is contained in:
parent
17e1ebe9dc
commit
89b9352d26
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue