Skip to content

Commit 5b6c567

Browse files
committed
bad memory access prevention
1 parent f0b79ff commit 5b6c567

File tree

1 file changed

+1
-1
lines changed
  • src/kaleidoscope/driver/speaker

1 file changed

+1
-1
lines changed

src/kaleidoscope/driver/speaker/Base.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Base {
4747

4848
void playTune(const uint16_t *notes, const uint16_t *durations, uint8_t length);
4949
void playTune(std::initializer_list<uint16_t> notes, std::initializer_list<uint16_t> durations) {
50-
playTune(notes.begin(), durations.begin(), notes.size());
50+
playTune(notes.begin(), durations.begin(), min(notes.size(), durations.size()));
5151
}
5252
virtual void stopTune();
5353
virtual void update();

0 commit comments

Comments
 (0)