Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Isaacs <75862+ben-xo@users.noreply.github.com>2021-07-29 22:59:04 +0300
committerBen Isaacs <75862+ben-xo@users.noreply.github.com>2021-07-29 22:59:04 +0300
commitdad51a9353780e9928e35cbfa192817677a90ca9 (patch)
tree6ef4cd5d4328258bb768565e6576b5fd0bbb82c6
parent5cc17b2be88982eb34b1998de22b83fee56d4f07 (diff)
Prevent FastLED from hanging on 0-length pixel arrays
Without this patch, a 0 length pixel array is treated as if it's 65535 long. Whilst few people will encounter this bug in simple applications, it comes up frequently when manipulating ranges of pixels with multiple PixelControllers.
-rw-r--r--src/platforms/avr/clockless_trinket.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/platforms/avr/clockless_trinket.h b/src/platforms/avr/clockless_trinket.h
index 2cfbef0d..3f333435 100644
--- a/src/platforms/avr/clockless_trinket.h
+++ b/src/platforms/avr/clockless_trinket.h
@@ -115,7 +115,9 @@ protected:
mWait.wait();
cli();
- showRGBInternal(pixels);
+ if(pixels.mLen > 0) {
+ showRGBInternal(pixels);
+ }
// Adjust the timer
#if (!defined(NO_CORRECTION) || (NO_CORRECTION == 0)) && (FASTLED_ALLOW_INTERRUPTS == 0)