Skip to content

Commit

Permalink
Fix for Aircoookie#3672
Browse files Browse the repository at this point in the history
  • Loading branch information
blazoncek authored and softhack007 committed Jan 15, 2024
1 parent d0e36bd commit 854425e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions wled00/udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -562,13 +562,13 @@ void handleNotifications()
if (realtimeOverride && !(realtimeMode && useMainSegmentOnly)) return;

uint16_t totalLen = strip.getLengthTotal();
if (udpIn[0] == 1) //warls
if (udpIn[0] == 1 && packetSize > 5) //warls
{
for (int i = 2; i < packetSize -3; i += 4)
{
setRealtimePixel(udpIn[i], udpIn[i+1], udpIn[i+2], udpIn[i+3], 0);
}
} else if (udpIn[0] == 2) //drgb
} else if (udpIn[0] == 2 && packetSize > 4) //drgb
{
uint16_t id = 0;
for (int i = 2; i < packetSize -2; i += 3)
Expand All @@ -577,7 +577,7 @@ void handleNotifications()

id++; if (id >= totalLen) break;
}
} else if (udpIn[0] == 3) //drgbw
} else if (udpIn[0] == 3 && packetSize > 6) //drgbw
{
uint16_t id = 0;
for (int i = 2; i < packetSize -3; i += 4)
Expand All @@ -586,7 +586,7 @@ void handleNotifications()

id++; if (id >= totalLen) break;
}
} else if (udpIn[0] == 4) //dnrgb
} else if (udpIn[0] == 4 && packetSize > 7) //dnrgb
{
uint16_t id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
for (int i = 4; i < packetSize -2; i += 3)
Expand All @@ -595,7 +595,7 @@ void handleNotifications()
setRealtimePixel(id, udpIn[i], udpIn[i+1], udpIn[i+2], 0);
id++;
}
} else if (udpIn[0] == 5) //dnrgbw
} else if (udpIn[0] == 5 && packetSize > 8) //dnrgbw
{
uint16_t id = ((udpIn[3] << 0) & 0xFF) + ((udpIn[2] << 8) & 0xFF00);
for (int i = 4; i < packetSize -2; i += 4)
Expand Down

0 comments on commit 854425e

Please sign in to comment.