mirror of
https://github.com/wled/WLED.git
synced 2025-07-28 05:06:34 +00:00
Prevent crash during blend if led init fails, https://github.com/wled/WLED/issues/4782
This commit is contained in:
parent
b79e81f3be
commit
e5ba97bbe2
@ -1344,6 +1344,11 @@ void WS2812FX::blendSegment(const Segment &topSegment) const {
|
|||||||
uint8_t opacity = topSegment.currentBri(); // returns transitioned opacity for style FADE
|
uint8_t opacity = topSegment.currentBri(); // returns transitioned opacity for style FADE
|
||||||
uint8_t cct = topSegment.currentCCT();
|
uint8_t cct = topSegment.currentCCT();
|
||||||
|
|
||||||
|
if (length == 1) {
|
||||||
|
// Can't blend only a single pixel, prevents crash when bus init fails
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Segment::setClippingRect(0, 0); // disable clipping by default
|
Segment::setClippingRect(0, 0); // disable clipping by default
|
||||||
|
|
||||||
const unsigned dw = (blendingStyle==BLEND_STYLE_OUTSIDE_IN ? progInv : progress) * width / 0xFFFFU + 1;
|
const unsigned dw = (blendingStyle==BLEND_STYLE_OUTSIDE_IN ? progInv : progress) * width / 0xFFFFU + 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user