That will avoid crashes when passing an invalid index (if the returned pointer is checked on the caller side).
For example, an animation tracksOffset may be -1 if the track wasn't found when converting from an edit anim (see EditDataSet.getPatternTrackOffset() and EditDataSet.getPatternRGBTrackOffset())
The value is directly used like this in the firmware: animationBits->getTrack(tracksOffset + i)
That will avoid crashes when passing an invalid index (if the returned pointer is checked on the caller side).
For example, an animation
tracksOffset
may be -1 if the track wasn't found when converting from an edit anim (seeEditDataSet.getPatternTrackOffset()
andEditDataSet.getPatternRGBTrackOffset()
)The value is directly used like this in the firmware:
animationBits->getTrack(tracksOffset + i)