From 7459cbd2e2dfd8fc064e0b13f21b9930c9fd5786 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 22 Dec 2025 01:38:49 +0100 Subject: [PATCH] setRealtimePixel robustness improvement avoid drawing negative pixel addresses (could happen when arlsOffset is < 0) --- wled00/udp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/udp.cpp b/wled00/udp.cpp index 2e39ca51..f5d1e788 100644 --- a/wled00/udp.cpp +++ b/wled00/udp.cpp @@ -692,7 +692,7 @@ void handleNotifications() void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w) { int pix = i + arlsOffset; - if (pix < theStripLength) { // WLEDMM use cached length + if (unsigned(pix) < theStripLength) { // WLEDMM use cached length if (!arlsDisableGammaCorrection && gammaCorrectCol) { r = gamma8(r); g = gamma8(g); @@ -701,7 +701,7 @@ void setRealtimePixel(uint16_t i, byte r, byte g, byte b, byte w) } if (useMainSegmentOnly) { //Segment &seg = strip.getMainSegment(); - if ((theMainSeg) && (pix < theMainSegLength)) theMainSeg->setPixelColor(pix, r, g, b, w); // WLEDMM used cached main segment + if ((theMainSeg) && (unsigned(pix) < theMainSegLength)) theMainSeg->setPixelColor(pix, r, g, b, w); // WLEDMM used cached main segment } else { strip.setPixelColor(pix, r, g, b, w); }