GameWithPixels / DiceFirmware

Pixels dice firmware code.
MIT License
15 stars 1 forks source link

AnimationBits::getTrack() should return a pointer, so it can be null #57

Open obasille opened 2 years ago

obasille commented 2 years ago

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)