Skip to content

RGBCalibrate example - index out of bounds #928

Closed

Description

@toybuilder

The NUM_LEDS for the example is 6. But the code writes to leds[0] through leds[6].
leds[6] is out of bounds and crashes the example on ESP32.

Activity

  1. toybuilder commented on Nov 29, 2019

    @toybuilder
    Author

    Small change made to fix this in the example. Pull request made.

  2. added
    area: examples
    status: stale
    status: triage
    on Apr 16, 2026
  3. added a commit that references this issue on Jul 2, 2026
  4. zackees commented on Aug 1, 2026

    @zackees
    Member

    Closing — fixed. @toybuilder's PR landed.

    The example now declares NUM_LEDS 7 (examples/RGBCalibrate/RGBCalibrate.ino:30), and the writes are leds[0] through leds[6] — indices 0–6, exactly 7 elements. In bounds.

    Good catch, and the crash-on-ESP32 detail was the useful part: on AVR an out-of-bounds LED write silently corrupts adjacent memory (see #887, where it clobbered a neighbouring variable and looked like a variable spontaneously resetting), while the ESP32 faults outright. Same bug, and the platform that fails loudly is the one that makes it findable.

    Worth noting the example is meant to have 7 entries — one per calibration colour plus a trailing off pixel — so raising NUM_LEDS was the right fix rather than dropping the last write.

  5. moved this from Triage to Done in FastLED Trackeron Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: examplesstatus: stalestatus: triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions